Chapter 2: Names, lost packets, and trust

DNS, the internet's phone book

How a name like wikipedia.org turns into an address, and why that usually takes milliseconds.

Lesson 4 of 6 · 3 min read · By the Learnfold team · Updated

Routers move packets by number. People remember names. The Domain Name System, DNS, connects the two. You hand it a name like wikipedia.org and it hands back an IP address.

It's often called the internet's phone book, and that's close. The difference is that no single book exists. The directory is split across a huge number of servers, and each one is responsible for its own small part.

Read the name backwards

DNS reads names from right to left. Take en.wikipedia.org. The last part, org, is a top-level domain. Wikipedia registered its name under org. Then Wikipedia created en under its own name, for the English site. Each level hands control of the level below to someone else, which is how one system can cover every name on the internet without one owner.

A lookup, step by step

Your phone doesn't do the hard work itself. It asks a resolver, a server run by your internet provider or by a company you've chosen. If the resolver already has the answer saved, it replies at once. If not, it walks down the levels:

  1. It asks a root server who handles org. The root server doesn't know Wikipedia's address, but it knows which servers are in charge of org.
  2. It asks one of those org servers who handles wikipedia.org. They point it to Wikipedia's own name servers.
  3. It asks Wikipedia's name servers for en.wikipedia.org and finally gets the address.

The resolver passes the address back to your phone and keeps a copy for next time.

Interactive. Try it here or in the app.

Step through the lookup and watch every reply return to the resolver. Turn on the cached answer to skip the referrals.

There are only 13 root server names, run by about a dozen organizations. Each name is really a fleet of machines spread around the world that all answer to the same address, so your question reaches a nearby one.

Saved answers keep it fast

If every lookup went all the way to the root, the root servers would drown. Instead, every answer comes with a time to live, a number of seconds it may be reused. A popular name is almost always saved at your resolver already, so the full walk is rare.

The catch shows up when a site changes its address. Some people keep getting the old one until their saved copy expires.

The answer depends on who asks

Big sites keep copies of their content in data centers all over the world. Their name servers often reply with the address of a copy near you. Someone in Tokyo and someone in Toronto can type the same name, get different numbers, and both be right.

When DNS breaks

If DNS fails, the internet looks dead even though every cable works. Your connection is fine. Your phone just can't turn names into addresses. A surprising number of large outages turn out to be DNS problems, often a bad configuration change.

Rabbit holes

Questions worth chasing. In Learnfold, tap one and your tutor answers it as a new lesson in your course.

  • Who runs the root servers, and what would happen if they all went offline?
  • When I buy a domain name, who actually records that it's mine?
  • Can my internet provider see every site name I look up?
Follow these in Learnfold

Keep going in Learnfold

In the app you can ask about any sentence, follow a question into a new lesson, and pick up where you left off. This lesson opens right where you are.

Personalize has Learnfold’s tutor ask what you already know and what you want from it, then build a version of this course just for you. It uses AI, which needs a Learnfold subscription.

No app yet? Get Learnfold free

Get Learnfold

Learnfold is free on the App Store for iPhone, and this course is free to read in it.

  1. Get the app. Tapping the App Store button also copies this course’s link to your clipboard.
  2. Open Learnfold and tap Paste on the first screen to start with this course.
Download on the App StoreDownload on the App Store

Scan with your iPhone camera to open this course there. If Learnfold is installed it opens straight in the app.

Or send yourself the link:

Or see Learnfold on the App Store