The problem DNS solves

Computers communicate using IP addresses — numeric labels like 93.184.216.34. Humans communicate using names like example.com. DNS is the system that bridges these two worlds, acting as the internet's phonebook.

But unlike a phonebook, DNS is distributed across millions of servers worldwide, with no single authority holding all the answers. This is what makes it both resilient and fascinating.

The lookup chain

When you type a URL, the following happens — and it happens in milliseconds:

Step 1: Local cache check
Your browser first checks its own DNS cache. If you visited this domain recently, the answer is already stored locally and the lookup ends here.

If the cache misses, the request goes to your operating system's resolver — which checks its own cache, and then the /etc/hosts file (a local override table).

Step 2: Recursive resolver
Your OS sends the query to a recursive resolver — typically operated by your ISP or a public service like Cloudflare (1.1.1.1) or Google (8.8.8.8). This resolver does the heavy lifting on your behalf.

Root servers and the hierarchy

If the recursive resolver doesn't have a cached answer, it begins a descent through the DNS hierarchy:

  1. It asks one of 13 root name servers — which don't know the final answer, but know who to ask next.
  2. The root server returns the address of the TLD name server for .com, .org, etc.
  3. The TLD server returns the authoritative name server for the specific domain.
  4. The authoritative server finally returns the actual IP address.

This entire chain — root → TLD → authoritative — is called iterative resolution. The resolver does each step itself, rather than asking each server to do the lookup for it.

Why it's fast

DNS responses include a TTL (Time to Live) value — the number of seconds a resolver should cache the answer. A TTL of 3600 means the answer is cached for an hour. This aggressive caching is what makes DNS fast at scale. The root servers only handle a fraction of the world's DNS traffic because resolvers cache their responses for days.

Key insight: DNS is a distributed caching system that degrades gracefully. Even if some servers are unreachable, queries find alternative paths through the hierarchy.

What I found interesting

Before digging into this, I assumed DNS was a simple lookup table. The reality — a hierarchy of authoritative servers, with caching at every layer, resilient to individual failures — is a much more elegant distributed system. It was designed in 1983 and still scales to handle trillions of queries a day.

There's a lesson here about good system design: solve the right problem simply, let caching do the scaling work, and distribute authority so no single point can fail everything.