Point a domain at your VPS

A domain reaches your server through two DNS records at the place that hosts your zone: an A record with the server IPv4 address and an AAAA record with one IPv6 address from its /64. Add www, pick a TTL, and verify from outside before you request a certificate.

Where do you edit DNS for your domain?

At whoever runs the nameservers for the domain, which is not always the company you bought it from. Find out with:

dig +short NS example.com

If the answer names your registrar, edit records in the registrar panel. If it names a separate DNS provider, edit them there; changes at the registrar will have no effect. CheapVPS does not host DNS zones, so your records always live with your registrar or DNS provider, and the server only needs to answer on its IP.

Which addresses should the records use?

The IPv4 address on the server page, and one address you choose from the IPv6 /64 network. On the server, see which IPv6 address is already configured:

ip -6 addr show scope global

The line with inet6 shows something like 2001:db8::10/64. Use that exact address for the AAAA record. A /64 contains far more addresses than you will ever need, but a record must point at one that is actually configured on the interface, otherwise IPv6 visitors get timeouts.

Both addresses stay the same when you rebuild the server with another image, so DNS does not need to change after a reinstall. They do change if you move to a different server, which is covered in moving to a bigger plan.

What records does a typical site need?

Four lines cover most websites:

NameTypeValueTTL
@A203.0.113.103600
@AAAA2001:db8::103600
wwwCNAMEexample.com.3600
@CAA0 issue "letsencrypt.org"3600

The @ stands for the bare domain. The www CNAME means you only maintain addresses in one place: when the server changes, www follows. A CNAME cannot sit on the bare domain itself, which is why the apex gets A and AAAA directly. The CAA record says which certificate authority may issue certificates for the domain; it is optional, but if you add it, it must list the authority you actually use.

For a second service on the same server, add more names, for example app with an A and AAAA record to the same addresses, and let Nginx choose by host name.

What TTL should you choose?

3600 seconds (one hour) for normal operation, 300 seconds around a planned change. The TTL tells resolvers how long they may cache an answer. A low TTL makes changes spread fast but means more lookups; a high one is efficient but slow to update.

The catch is that lowering a TTL only works after the old value has expired. If the record had a TTL of 86400 (one day), set 300 at least a day before the planned switch. After the change has settled, raise it again.

How do you check that the records are live?

Ask a public resolver and your own default resolver, and compare:

dig +short example.com A @1.1.1.1
dig +short example.com AAAA @8.8.8.8
dig +short www.example.com

All should return the addresses you set. If a public resolver still shows an old value, it is cached; wait out the TTL. To see the authoritative answer without any cache, follow the chain from the root with dig +trace example.com; the last section comes straight from your nameservers.

On Windows without dig, nslookup example.com 1.1.1.1 gives the same information. Then confirm the server answers on that name: curl -I http://example.com should return response headers from your web server, and curl -6 -I http://example.com checks the IPv6 path on its own.

Why does a new record sometimes not resolve?

Most failures come from a short list of slips. A trailing dot missing or added in the wrong panel can turn example.com into example.com.example.com; check the full name in the dig output. An old AAAA record left over from a previous host sends IPv6 visitors somewhere else, so delete records you no longer use. Some panels add a default parking A record that competes with yours; there should be exactly one A record per name unless you mean to balance.

Negative answers are cached too. If you looked up the name before creating it, resolvers may remember "no such name" for the negative TTL in the SOA record, often 300~3600 seconds. Use dig example.com SOA to see it, and test with a fresh name if you are impatient.

What about mail records and reverse DNS?

Records for mail (MX, SPF, DKIM, DMARC) live in the same zone, but running a mail server needs two things outside DNS: outgoing port 25 and a reverse DNS entry (PTR) for the server IP. Reverse DNS is not self-service in the console, so open a support ticket and ask about port 25 and the PTR record before you build a mail server. Even if you never send mail yourself, an SPF record that says so, v=spf1 -all as TXT on the bare domain, stops others from forging your domain.

To send app email without a mail server, use an outside email sending service over its API or on port 587, and add the SPF and DKIM records it gives you.

What comes after DNS?

A certificate. Once dig returns your server addresses from public resolvers and port 80 is open in the firewall, request a free certificate with Certbot as shown in the Nginx and HTTPS guide. Certificate authorities check the domain over DNS and HTTP from several places, so a record that is not yet visible everywhere is the most common reason a first attempt fails. If that happens, wait out the TTL and try again rather than repeating the request many times, since there are limits on failed attempts per hour.

Questions about this guide

How long until a new domain works?

A brand new record is usually visible within minutes. A changed record takes up to its old TTL. New domains at some registrars need a little longer before their nameservers answer at all.

Can I use a subdomain only?

Yes. Create A and AAAA records for the name you want, such as app.example.com, and leave the bare domain where it is.

Do I need an AAAA record?

It is optional but recommended, since every server includes an IPv6 /64 at no extra cost. Only add it once the address answers, which you can test with curl -6.

Can CheapVPS host my DNS zone?

No, DNS is kept at your registrar or DNS provider. The server only needs the records described here.

Can I set reverse DNS for my IP myself?

Not in the console. Ask support in a ticket, and ask about outgoing port 25 at the same time if you plan to send mail.

Does a rebuild break my DNS?

No. A rebuild keeps both the IPv4 address and the IPv6 network, so your records stay valid; only the software on the disk changes.