To point a domain to a VPS, you create an A record with the server's IPv4 address in the domain's DNS zone, plus an AAAA record if the server has IPv6. For a subdomain like www, a CNAME record that points to another hostname is the usual choice. Once you save the records, browsers won't find your server instantly: it takes some propagation time, which depends on the TTL. Below we cover the record types, the setup steps, and how to check everything with dig and nslookup.

The DNS records that matter

DNS stores more than IP addresses. To point a website at a server, you'll mostly deal with four record types, each with its own job.

  • A maps a name to an IPv4 address, for example example.com → 203.0.113.10. This is the main record for a website.
  • AAAA maps a name to an IPv6 address. Add it if your server has a public IPv6. Clients without IPv6 fall back to the A record, so always keep the A record.
  • CNAME makes one name an alias for another: www.example.com → example.com. A name with a CNAME can't have any other records.
  • TXT holds text. It's used to verify domain ownership, for email authentication (SPF, DKIM) and for issuing some certificates.

There are also MX records for mail and NS records for nameservers, but you usually don't touch them when pointing a site at a VPS.

TTL and DNS propagation

TTL (time to live) is how many seconds resolvers may cache an answer. 3600 means one hour. While the old record is cached, some visitors will still land on the old IP. So before moving a server to a new address, lower the TTL ahead of time, say to 300 seconds, wait for the old TTL to run out, and only then change the IP.

There's no guaranteed propagation time. A new record usually shows up within minutes, but some ISPs cache longer than the TTL says. Avoid changing records over and over: every change restarts the clock.

Step 1. Find your server's IP

You'll see the server's address in your VPS control panel. You can also get it on the server itself. Know the difference between the address the server sees and its public address: on NAT plans, the server may have a private address internally while the public one belongs to a shared gateway.

ip -4 addr show
ip -6 addr show scope global
curl -4 ifconfig.me

If the last command matches the address on the interface, the server has a public IPv4. If they differ, the server is behind NAT. More on that below.

Step 2. Add the records at your registrar or DNS host

You create records in the dashboard of whichever service hosts your domain's DNS zone: your registrar, or a separate DNS provider such as Cloudflare. The UIs differ, but the fields are the same: type, name (host), value and TTL. For the root domain, the name is usually @ or left blank.

  • Type A, name @, value = server IPv4, TTL 300 or 3600: the site loads at example.com.
  • Type A, name www, value = server IPv4: the site loads at www.example.com.
  • Type AAAA, names @ and www, value = server IPv6: add these if your VPS has a public IPv6.
  • Type CNAME, name www, value example.com: an alternative to the A record for www.

www or the root domain?

The root domain example.com and the subdomain www.example.com are two different names, and you have to set up both if you want both to work. The cleaner option is to pick one as primary and redirect the other on the server. In Nginx that's a separate server block, as shown in how to host a website on a VPS with Nginx and SSL.

One catch: you can't put a CNAME on the root name. A CNAME rules out every other record on the same name, and the root always has NS and SOA records. So the root points to the server with an A or AAAA record. Some DNS providers offer ALIAS or ANAME records for the root, but those are their own extensions, and behavior varies by provider.

Step 3. Check with dig and nslookup

Check your records with DNS queries, not the browser. That way you see exactly what DNS returns, without the browser cache getting in the way. dig ships in the dnsutils package on Debian and in bind-utils on some other systems. On Ubuntu and Debian it's one command:

sudo apt install -y dnsutils
dig +short example.com A
dig +short www.example.com A
dig +short example.com AAAA
dig +short www.example.com CNAME
dig @8.8.8.8 +short example.com A

+short prints just the answer. The last command asks Google's public DNS, which is handy when your local resolver is still holding the old value. For the full picture, run dig example.com A without +short: the second column of the answer shows how many seconds the record has left in cache.

nslookup example.com
nslookup -type=A www.example.com 8.8.8.8

If dig or nslookup returns the right IP but the browser doesn't, flush your local DNS cache or wait for the TTL to expire. If even the public resolver shows the old address, check that the record actually saved in the dashboard and that there's no leftover duplicate with the old value in the zone.

NAT VPS vs. dedicated IPv4

That's why a dedicated IPv4, or a public IPv6 if your plan has one, works better for a website. A dedicated IPv4 gives you a direct connection through the A record, no forwarding rules needed. On Pulsar, the Nano plan comes with a dedicated IPv4, while the NAT plan uses a shared IPv4 with forwarded ports, plus IPv6. Read more in NAT VPS vs. dedicated IP.

IPv6 works too, but an AAAA record only helps visitors who have IPv6. For a public website, an A record with IPv4 is still a must.

Wrapping up

To point a domain to your VPS, create A records for the root and for www, add AAAA if you have IPv6, and use a CNAME for www if you prefer. Verify with dig or nslookup, keep TTL in mind, and remember the root can't be a CNAME. If your server is behind NAT, sort out port forwarding first. Need a domain? Pulsar registers domains in 99 zones from ₽349/year, with DNS managed in the same dashboard as your VPS: see Domains on Pulsar. Next, get your server ready with how to connect to a VPS over SSH.