DNS: Turning Names Into Numbers
You like names. Computers like numbers. There has to be something in the middle that turns one into the other.
That something is DNS — the Domain Name System. When you type portmint.com, your computer can't actually reach a word. It needs the IP address, the numbered street address we met last lesson. DNS is the helper that looks up the number for the name.
Picture an old phone book. You know your friend's name; you flip to it and read off the number. DNS is that flip, done in a fraction of a second, every time you open a page.
Following the lookup
No single book holds every name on the internet — there are far too many. So the lookup travels through a small chain of helpers, each one pointing closer to the answer.
It works like asking for someone in a big building. You ask the front desk where "Marketing" is. They don't know the exact desk, but they say, "third floor." On the third floor, someone says, "second door." Behind that door, you finally find the person.
DNS does the same hand-off. A helper called a resolver asks the top-level system, "who handles .com names?" That points it toward the servers responsible for portmint.com. Those servers hand back the actual IP number. Now your computer knows where to knock, and the page loads.
Each step doesn't know the whole answer. It just knows who to ask next. That's how a system this enormous stays organized — nobody holds everything, everyone holds a piece.
Why answers get remembered
Doing that whole chain every single time would be slow and wasteful. So DNS remembers. This is called caching.
Once your computer learns that portmint.com lives at a certain number, it jots that down and keeps it for a while. The next time you visit, it skips the phone-book flip entirely and uses the number it already has. Your internet provider keeps its own notes too, so popular names are answered almost instantly.
Each note comes with a quiet expiration — a "good until" time. After that, the helper checks again, in case the number changed. Fresh enough to be useful, short enough to stay honest.
A steady name over a changing number
Here's the quiet gift in all this. The name can stay the same while the number underneath it changes.
Think of a business that keeps its phone number on the sign but moves to a new office. As long as the directory is updated, you still find them — you never had to memorize the new address. A website can move to a new server, get a new IP, and you'd never notice. You typed the same name; DNS pointed it at the new number. 🔦
That's the whole trick: humans hold the name, machines hold the number, and DNS keeps the two in sync.
Your turn
Open a terminal and run nslookup portmint.com (or any site you like). It will print one or more IP numbers — the answer DNS just looked up for you. Try a second site and compare. You're seeing the phone-book flip with your own eyes.
Next we'll cut the message itself into pieces — "Packets: The Postcards of the Net."
Stuck or curious?
Ask Pip about this lesson — tap the porthole bottom-right.