You bought a VPS and a domain. To make the domain open your server, you need DNS records. This guide explains the records that matter, how long changes take and how to check that it worked.
The three records you need most
| Type | Name | Value | Purpose |
|---|---|---|---|
| A | @ | Your server's IPv4 address | Points the bare domain (example.com) |
| A | www | Your server's IPv4 address | Points www.example.com |
| AAAA | @ | Your server's IPv6 address | Optional, only if the VPS has IPv6 |
A CNAME record makes one name an alias of another, for example www pointing at example.com. You cannot use a CNAME on the bare domain, which is why the root uses an A record.
Step by step
- Find your server's public IP address in your dashboard.
- Open the DNS settings for your domain. If you registered it with us, this is in the Domains section of your dashboard.
- Delete any old A records for the same names, such as parking pages.
- Add the A records from the table above.
- Save, then wait for the change to spread.
How long does DNS take?
Each record has a TTL (time to live) in seconds. Resolvers around the world cache the old answer until it expires. A TTL of 300 means about five minutes; 3600 means up to an hour. Lower the TTL a day before a planned move, then raise it again afterwards. New records on a name that never existed usually appear within minutes.
Check that it worked
dig +short example.com
dig +short www.example.com
nslookup example.com 1.1.1.1
Both names should print your server's IP. If one still shows the old address, you are waiting on a cache. Querying a public resolver such as 1.1.1.1 or 8.8.8.8 avoids your own router's cache.
Email records (if you send mail)
- MX tells the world where to deliver your mail.
- SPF (a TXT record) lists the servers allowed to send for your domain.
- DKIM (a TXT record) publishes the key used to sign your messages.
- DMARC (a TXT record) tells receivers what to do with mail that fails the checks.
Frequent mistakes
- Adding the record at the registrar while the domain uses other nameservers. DNS is edited wherever the nameservers point.
- Typing the full domain in the Name field, which some panels turn into
example.com.example.com. - Forgetting to set up the web server for the domain after DNS works. Pointing is only half the job; see our Nginx guide.