Network & Connectivity

DNS

How to configure your server's DNS and point a domain to your VPS

Point a Domain to Your Server

To associate a domain with your VPS, you need to add DNS records at your domain registrar (where you bought the domain) or with your DNS provider.

A Record (IPv4)

Create an A record pointing to your IP:

NameTypeValueTTL
@ASERVER_IP3600
wwwASERVER_IP3600

AAAA Record (IPv6)

If the server has an IPv6 address:

NameTypeValueTTL
@AAAAIPv6_SERVER3600

CNAME Record (Alias)

To point a subdomain to another hostname:

NameTypeValue
wwwCNAMEexample.com.

DNS Propagation

After modifying DNS records, changes take time to propagate across the internet (from 15 minutes up to 48 hours). You can check the propagation status with:


Verify DNS from the Server

# Resolve a domain
nslookup example.com

# Detailed resolution
dig example.com

# Check MX record (email)
dig example.com MX

# Check which DNS server is being used
cat /etc/resolv.conf

Change Server DNS (Resolver)

Your server's DNS determines which servers it uses to resolve names. Edit /etc/resolv.conf:

nameserver 8.8.8.8
nameserver 1.1.1.1

On systems with systemd-resolved:

# Edit the configuration file
nano /etc/systemd/resolved.conf
[Resolve]
DNS=8.8.8.8 1.1.1.1
FallbackDNS=9.9.9.9
systemctl restart systemd-resolved

Add a Local Hostname (/etc/hosts)

To map names to IPs without DNS (useful for local testing):

nano /etc/hosts

Add:

192.168.1.100    my-server.local

ProviderPrimarySecondary
Google8.8.8.88.8.4.4
Cloudflare1.1.1.11.0.0.1
Quad99.9.9.9149.112.112.112

On this page