DNS — Explain Like I'm 5

The Phonebook Nobody Carries

Back when phones had cords, everyone had a phonebook. You didn’t dial your friend’s actual number from memory — you looked up “Sarah” and the book told you the digits.

DNS is exactly that, but for websites. And instead of one big book, it’s a chain of helpers that pass the question along until someone finds the answer.

Why Numbers at All?

Every device on the internet has a numerical address — like 142.250.80.46 for Google. Computers love these. But you’re not going to type that every morning. You type google.com and expect it to work.

DNS bridges that gap. It’s a system that translates the name you typed into the number computers actually use.

Picture a Post Office With Helpers

You walk into a post office and ask: “Where does Sarah live?”

The clerk at the front says “I don’t know, but I know who to ask.” They call the neighborhood office. The neighborhood office says “I know her street — try the house number office.” That office has the answer: 14 Maple Lane.

The whole trip took less than a second. That’s a DNS lookup.

The first clerk is your computer’s DNS resolver. The neighborhood office is a “TLD nameserver” (it handles .com or .org). The house number office is the authoritative nameserver for that specific website.

What Happens When You Hit Enter

You type google.com and press Enter:

  1. Your laptop checks its own memory first — have I looked this up before?
  2. If not, it asks your router (which might know)
  3. If not, it asks your internet provider’s DNS server
  4. That server works its way up the chain until it finds the answer
  5. The answer comes back: here’s the number, go there

The whole thing usually takes under 30 milliseconds. You never notice it happening.

The “Cache” Thing

DNS systems remember answers for a while. If 10,000 people looked up youtube.com in the last hour, the servers already have the answer cached and can respond instantly without running the whole chain again.

That memory has an expiry time — set by the website owner. Big sites usually set it to several hours. That’s why if a website moves to a new server, it can take a few hours before everyone in the world starts reaching the new address.

One Thing to Remember

DNS is a distributed phonebook that translates human-readable names into machine-readable numbers. Without it, you’d need to memorize number strings to visit any website — and the internet would be a lot lonelier.

networkinginternetinfrastructuredns