;colony/science  / Computers, Visually  / How does DNS find a website?
Computers, Visually

How does DNS find a website?

Computers can't talk to names, only to numbers. So every time you type a web address, a quiet relay of helpers turns that name into a number before anything loads.

Plate 115 — The internet’s phonebook name → IP · root → TLD → host · cached
Step through a lookup, then repeat it — instant.
Predict firstBefore stepping through it, how much faster should a cached lookup be than a cold one?
a name becomes an address by asking down the tree — then it's rememberedthe name you typedmaps.example.compress Step to start the lookup 1root 2TLD · .com 3authoritative 4your computer
PLATE 115 · THE INTERNET'S PHONEBOOK
Website name
Step through the lookup. Resolve the same name twice — the second time is instant.
Servers asked
0hops
In the cache?
no
A computer can only talk to numbers (addresses), not names. So when you type a name, your computer asks a chain of helpers: first a root server ("who knows .com?"), then the .com server, then the website's own server, which finally hands back the number. Then it remembers the answer, so next time it's instant. Look one up, then look it up again and watch.
Try with the plate
  • Step through a cold lookup from root to authoritative server.
  • Look the same name up again and watch it return from cache.

DNS finds a website by translating its human name into the numeric IP address machines actually use. A resolver walks a hierarchy: it asks a root server, which refers it to the .com server, which refers it to the domain's own authoritative server, which returns the address.

The short answer

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.

The common mix-up

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.

Remember this

DNS splits one impossible phonebook into a tree it walks once, then caches, so billions of lookups stay near-instant.

Try it at home Be the resolver
  1. 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?"
  2. 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.
  3. 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

Why is the first visit to a new site sometimes slower?

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.

How many root servers are there?

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.

Why does the web seem to go down during a DNS outage?

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.

Built & checked by Nilesh Singh · how this is made · last updated June 2026