AlgoViz
Networking
Networking · EasyLesson 8 of 13

DNS — the internet's phonebook

Computers find each other by number — an IP address like 142.250.72.14. But you don't remember numbers; you remember names like google.com. DNS (the Domain Name System) is the bridge: a giant phonebook for the internet that turns a name you type into the IP number the network can actually deliver to. Every time you visit a site, DNS quietly runs first.

Names for humans, numbers for machines

You'd never remember 142.250.72.14, but you easily remember 'google.com.' That's the whole reason DNS exists: people are good at names, machines need numbers. So we let you type the friendly name, and DNS looks up the matching number behind the scenes. It works exactly like a phonebook. You know your friend's NAME but you need their phone NUMBER to actually call. You flip to the name, read off the number, then dial. DNS does that flip for the internet — name in, number out — so fast you never notice it happened.

How the lookup happens — the resolver chain

Your computerwants google.comResolverdoes the askingRoot server.com (TLD)google's serverhas the answername123IP number
Your computer hands the name to a resolver. The resolver asks the root, then the .com server, then google's own server — and the IP comes back.

Nobody owns one giant phonebook with every name in it — that would be impossible to keep updated. Instead the answer is found in a few short hops: 1. Your computer asks a helper called a RESOLVER (usually run by your internet provider): 'what's the IP for google.com?' 2. The resolver asks a ROOT server: 'who handles .com names?' The root points it to the .com server. 3. The resolver asks the .com server (the TLD, short for top-level domain): 'who handles google.com?' The .com server points it to google's own server. 4. The resolver asks that final AUTHORITATIVE server — the one that truly knows — and gets the IP address. The resolver hands that number back to your computer, and now your browser can connect. It sounds like a lot of steps, but each one is tiny and the whole thing usually finishes in a blink.

Caching: it's only slow the first time

If your computer had to walk that whole chain every single time, the internet would feel sluggish. So DNS CACHES answers — it remembers them for a while. Once the resolver (and your own computer) has learned that google.com is 142.250.72.14, it just reuses that number for the next visit instead of asking again. That's why the very first visit to a brand-new site can take a heartbeat longer, and every visit after feels instant. The answer is kept for a set time (called the TTL, 'time to live') and then re-checked, so changes eventually get picked up.

Questions you might have

Why can't I just type the IP number and skip DNS?

You actually can, sometimes — typing the IP into your browser can work. But IPs are hard to remember, they can change (a site might move to a new server), and one name like google.com can map to many IPs around the world. Names stay stable and friendly even when the numbers behind them shift, so we let DNS handle the lookup.

Who keeps this giant phonebook, and is there really one of it?

There's no single book — it's split up. Root servers know who handles each ending (.com, .org). The .com servers know who handles each .com name. Each website's owner runs the final 'authoritative' server with their own answer. Spreading it out means no one machine has to know everything, and any owner can update their own entry.

If DNS caches answers, what happens when a website moves to a new IP?

Each cached answer has an expiry timer (the TTL). Until it expires, you might keep using the old number; after it expires, the resolver asks again and learns the new one. That's why a site change can take a little while to reach everyone — the old answer has to age out of all the caches first.

Is DNS the thing that's broken when a site 'can't be found'?

Often, yes. If DNS can't turn the name into an IP — maybe the name is typo'd, the entry was removed, or your resolver is unreachable — your browser has no number to connect to and shows an error like 'server not found.' The page might be perfectly fine; the lookup just failed before you ever reached it.

🧠DNS is the internet's phonebook: it turns a human name like google.com into the IP number machines need, by asking a short chain of servers (resolver → root → .com → the site's own server) — and it caches the answer so it's instant next time.
✅ Check yourself4 quick questions — prove the idea stuck.Start →🧭 Take it furtherA new system you haven't read about — would you reach for this idea, and what does it cost?Try it →▶ Now watch it moveOpen the animation →

Best read after: IP addresses