How DNS works: the internet's phone book explained
Every time you load a website, a hidden lookup turns a name into an IP address. Here's what DNS is doing behind the scenes, step by step.
Computers talk to each other using IP addresses — numbers like 203.0.113.10. People prefer names like example.com. DNS, the Domain Name System, is the translation layer between the two. It's often called the phone book of the internet, and it runs billions of times a second without anyone noticing.
The problem DNS solves
You can't memorise the IP address of every site you visit, and IPs change over time as sites move servers. Names stay constant while the number behind them changes. DNS lets you use a stable, human-friendly name and always reach the right machine.
The lookup, step by step
Say you type example.com into your browser. Here's roughly what happens in the next few milliseconds:
- Your device checks its cache. If it looked this name up recently, it already knows the answer and stops here.
- It asks a resolver. Usually your ISP's or a public resolver like
1.1.1.1. The resolver does the legwork. - The resolver asks a root server. The root doesn't know
example.com, but it knows who handles.comand points the resolver there. - The resolver asks the .com TLD server. This server doesn't know the IP either, but it knows your domain's nameservers and points the way.
- The resolver asks your nameservers. These are *authoritative* — they hold your actual records and return the IP in your A record.
- The resolver replies to your device, which connects to that IP and loads the page.
All of that typically finishes in a fraction of a second.
Caching keeps it fast
If every visit ran the full chain, the internet would crawl. So answers are cached at every level for a period set by the record's TTL (time to live). A TTL of 3600 means "you can reuse this answer for an hour before checking again." Caching is why DNS is fast — and also why changes take time to appear everywhere.
The record types you'll meet
The authoritative nameservers store several kinds of records:
- A — a name to an IPv4 address.
- AAAA — a name to an IPv6 address.
- CNAME — a name to another name (an alias).
- MX — where email for the domain should go.
- TXT — arbitrary text, used for verification and email security.
Why this matters to you
Understanding the chain demystifies the two things people struggle with most:
- Propagation delays. When you change a record, old cached answers linger until their TTL expires. That's why a change can be visible to you but not a friend across the country yet.
- What to edit. To point a domain at a server, you edit the A record on your authoritative nameservers. You rarely need to touch anything higher up the chain.
Seeing it yourself
You can watch DNS answer a query with the dig command:
dig example.com +short
It returns the IP the name currently resolves to — the end result of the whole chain above.
Once DNS clicks, the rest of domain management stops feeling like magic. With Nxeon, your authoritative records live in the same dashboard as your server, so the last step of that lookup chain points wherever you set it — no guesswork.