DNS (Domain Name System) is the system that turns a domain name such as example.com into an IP address so your browser knows which server to connect to. Its settings are stored as "records". To point a domain at a VPS you usually create an A record that maps the name to the server's IP. Changes take effect within minutes to a few hours.
How does DNS work?
When you type a site's address, the browser asks a resolver, usually your internet provider's or a service such as 1.1.1.1 or 8.8.8.8, for the address. If it does not know the answer, it starts at the top: the root servers, then the server for the suffix (such as .com), and finally the name servers that hold that domain's records. The answer is cached for the time the TTL specifies, so the next lookup is faster.
What are the common DNS records?
- A: maps a name to an IPv4 address.
- AAAA: maps a name to an IPv6 address.
- CNAME: makes one name an alias of another (for example www to the main domain). It is usually not allowed at the domain root.
- MX: specifies the domain's mail server.
- TXT: free text, used for ownership verification and email settings such as SPF and DKIM.
- NS: the domain's authoritative name servers.
How do I point a domain at a VPS?
- Take the server's public IP.
- In the domain's DNS panel (at your registrar or a service like Cloudflare), create an A record for
@with the IP as its value. - If you want www to work, create a CNAME for
wwwpointing to the main domain. - Wait for propagation and check:
dig +short example.com- On the server, configure the web server (Nginx or Apache) for that domain and get an HTTPS certificate.
To reach and set up the server, read what SSH is.
TTL and propagation
TTL tells caches how long, in seconds, to keep an answer. If you plan to change servers, lower the TTL a few hours earlier (for example 300 seconds) so the move is seen faster. "Propagation" is really old answers expiring rather than a pushed update, which is why the time differs between users.
Common mistakes
- The A record points to a wrong or old IP.
- A CNAME was placed at the domain root.
- The name servers at the registrar are not where you created the records.
- Browser or system cache; on Windows
ipconfig /flushdnsrefreshes it.
Moving a website from hosting to a VPS is covered in VPS vs shared hosting.
Which tools check DNS?
dig MX example.com +short
dig TXT example.com +short
nslookup example.com 8.8.8.8With dig @1.1.1.1 example.com you query a specific resolver. If one network shows the old answer and another the new, the cache has not expired yet. Propagation-check websites also show the result from several countries.
An email note: MX, SPF and DKIM
If you send email from your domain, the MX record decides where incoming mail goes. TXT records for SPF (which servers may send) and DKIM (message signing) keep your messages out of spam. A self-hosted mail server is delicate work, and ready-made services are usually safer.
With CloudSnap
To point a domain at a server you need only its public IP, which the bot and the web panel show. If you change the IP or create a new server, update the A record. See VPS plans on the pricing page.
Summary
DNS turns names into IPs. To connect a domain to a server you create an A record, take the TTL into account and check with dig. Email and ownership verification use MX and TXT. Most problems come from a wrong IP or from caching.
FAQ
What is the difference between an A record and a CNAME?
An A record points straight to an IP, while a CNAME points to another name that itself resolves to an IP.
How long does a DNS change take?
From a few minutes to a few hours depending on the previous TTL, and sometimes up to 48 hours for slow caches.
Why does DNS matter for security?
Because whoever controls the records can send traffic to another server. Protect the registrar account with two-step verification.
Does DNS relate to a VPN?
Some VPNs route DNS requests through the tunnel so the internet provider does not see them.
Can I connect to a VPS without a domain?
Yes, by IP. A domain is only a memorable name.
