You type a name, a number comes back. Here is the chain of small servers behind it, and why DNS changes take time.
You type a website name and the page appears. But computers cannot use names. They only use numbers.
So something has to turn example.com into an address like 93.184.216.34 before anything loads. That something is DNS, the Domain Name System. The key idea: nobody holds the whole answer. DNS is a chain of small servers, and each one only knows who to ask next.
One list means one huge target and one huge bottleneck. RFC 1034, the original design document, wanted the data spread out and cached close to the people asking. So the work got split up.
The split follows the name itself. You read a domain from right to left, like a postal address that goes country, city, street.
So who actually answers at each layer? Meet the cast.
Four kinds of servers take part in a lookup.
| Server | Job | Like |
|---|---|---|
| Recursive resolver | Does the whole hunt for you and remembers answers | A helper who does the whole search for you |
| Root server | Knows who handles each TLD like .com | The city information desk |
| TLD server | Knows who handles each domain under that TLD | The district office |
| Authoritative server | Holds the real answer for the domain | The official address book |
The root has 13 server identities (A to M), run by 12 organisations according to root-servers.org. Each identity is really many machines around the world, but you don't need that yet.
Now let's see them work together.
Your phone doesn't do the hunt. It asks the recursive resolver, usually run by your ISP or something like 1.1.1.1 or 8.8.8.8. The resolver does the legwork.
Click Next and follow the question from your phone to the authoritative server and back.
Phone asks the resolver for the IP of example.com
Root and TLD never give the final answer. They only point to the next server. RFC 1034 calls this a referral. Doing the whole hunt for you is the optional part, called recursive service.
So that's six or seven hops for every single website. Why doesn't that feel slow?
Caching. A cache is a saved copy, so you don't redo the work. RFC 1034 gives a main goal of the resolver is to cut network delay and server load by answering from its saved copies.
The first lookup takes time. When the same name is asked again, the resolver already has the answer.
A number in each DNS record, in seconds, that tells resolvers how long they may keep a saved copy before asking again. RFC 1035 defines it as a 32 bit value. Zero means don't cache it.
Caching is great, until the answer changes.
Say you move your site to a new server and change its IP at the authoritative server. That change is instant there. But resolvers around the world still hold the old answer until its TTL runs out.
Some resolvers have the new answer and some still hold the old one. Nobody is wrong. They just have different copies.
The practical trick: lower the TTL before a planned move so old copies die quickly, then raise it again after.
Yes. dig is a small tool that asks DNS questions. It comes on most Linux and Mac setups, and in a package like dnsutils or bind-utils if you don't have it.
dig +trace example.com
The +trace flag makes dig do the hunt itself, starting at the root, so you see the same walk as the Stepper above. (Your output will differ, so run it and read the hops yourself.)
Now run plain dig example.com twice. The number in the answer line before the record type is the TTL. It counts down when a resolver serves you a cached copy.