When you want to call a friend you don't shout their name into the phone, you dial their number. Computers are the same: they only know how to reach numbers called addresses, not friendly names like a website. So when you type a name, your computer asks a chain of helpers to look up the number. First it asks a top helper who knows where the .com helper lives, then the .com helper, then the website's own helper, who finally hands back the number. Then your computer remembers it, so next time it's instant. It all happens in a fraction of a second, every single time you open a page. Type a name in the simulator and step through the lookup, then look it up again and watch it come back instantly.
Most people think typing a name takes you straight to the site. In fact machines only reach numbers, so the name must first be walked down a tree of servers and turned into an IP address before anything can load.
What's actually happening
It feels like typing a website name takes you straight there, the way pressing a labelled button rings a doorbell. But the machines underneath have no idea what a name is. Everything on the internet is reached by a number, an IP address like 93.184.216.34, and a name is just a convenient label humans prefer. Before your browser can fetch a single thing, that label has to be turned into a number, and the system that does it is DNS, the closest thing the internet has to a phonebook.
The clever part is that no single phonebook could possibly list every name on earth and stay up to date. So DNS splits the job into a tree and walks down it. A resolver first asks one of a small set of root servers, which doesn't know your website but does know who handles all .com names. It points the resolver at the .com server, which doesn't know your website either but knows which server is in charge of that specific domain. That final authoritative server is the one that actually holds the address and hands it back. Three handoffs, each one narrowing from the whole internet down to the single name you asked for.
Doing that walk for every click would be painfully wasteful, so the answer gets remembered. Once resolved, the name-to-number mapping is cached, at your computer and at servers along the way, for a set lifetime. The result is a striking split: a cold lookup that has to walk the whole tree takes tens of milliseconds, while a warm one served from cache is effectively free. It is why the very first visit to a brand-new site can feel a touch slower, and why everything after that is instant, and why this enormous lookup happens billions of times a second without anyone noticing it at all.
DNS splits one impossible phonebook into a tree it walks once, then caches, so billions of lookups stay near-instant.
- 1Pick a friend and imagine you only know "who to ask next", never the final answer. Ask person 1: "who handles surnames starting with S?"
- 2They send you to person 2, who handles all the S surnames and sends you to the one family. That family finally gives you the phone number.
- 3Write the number on a sticky note (your cache). The next time you want it, you skip all three questions. You have just performed a DNS lookup, and then a cached one.
Common questions
A cold lookup has to walk the whole tree, taking tens of milliseconds. Afterwards the name-to-number mapping is cached for a set lifetime, so warm lookups come back in well under a millisecond.
The whole system hangs off 13 named root server addresses, mirrored across hundreds of physical machines worldwide. Every name lookup on earth ultimately starts from one of them.
The sites themselves are often still running fine, but nobody can turn their names into numbers. With the lookup broken, to everyone it simply looks as though the internet has stopped.