Lesson 1 of 15
4. DNS

The picture to keep in your head

3 min read+10 XP

Every question below is answered twice: first in your phone's contacts, so you can picture it, then in the system, so you know exactly how it works. Each answer ends with a memory code to lock it in.

The picture to keep in your head

You don't remember your friends' phone numbers. You save them as "Amma", "Ravi", "Pizza place", and your phone turns the name into the number when you tap it. If a number isn't saved, you ask a well-connected friend who knows how to find anyone's number. And when someone changes their number, the people who saved the old one keep calling the old one until they update it.

That's DNS, the Domain Name System. Computers reach each other by IP address (a number like 203.0.113.20). People type names like shop.example.com. DNS is the phone book that turns names into numbers, for the whole internet.

Our running example: the online bookstore from Chapter 3, at shop.example.com. In Chapter 3, step 1 of typing a URL was "Find". This chapter is that step, in full.

In your phone's contactsIn the system
A contact's name ("Ravi")Domain name (shop.example.com)
Their phone numberIP address (203.0.113.20)
Your saved contactsBrowser and operating-system DNS cache
A well-connected friend who finds numbers for youRecursive resolver (your ISP's, or 8.8.8.8, 1.1.1.1)
A directory that tells you which directory to askRoot servers
The directory for one kind of numberTLD servers (.com, .in, .org)
The person's own office, which gives the official numberAuthoritative name server
"This number is valid until Friday"TTL (time to live)

(Addresses like 203.0.113.20 and 198.51.100.7 in this chapter are reserved for documentation examples. They don't belong to any real server.)

the phone-number hunt mapped to the DNS lookup chain.

Figure: finding a phone number and finding an IP address work the same way. Nobody knows every number, but everyone knows who to ask next.