Appearance
DNS: Names to Numbers
Season 2 · Note 4
In Plain English (30-Second Refresher)
TL;DR
Routers only understand numbers, so before any trip, a name like coindash.example must become an IP (Internet Protocol) address. That's the job of DNS (Domain Name System): the internet's address book.
- Your device checks its cache (recent answers), then asks a resolver.
- The resolver walks the chain: root server → top-level domain server (".example") → the domain's own authoritative server, which gives the official answer.
- Every answer comes with a TTL (time to live): how many seconds it may be cached. Repeats take ~0 ms (milliseconds), but changes are slow to spread.
The Mission We Follow
Coin Dash wants to send your score to coindash.example. It can't send a single packet until it knows the server's number: 198.51.100.20.
Real-World Analogy: Finding an Office's Address 📮
| In real life | In DNS | What it does |
|---|---|---|
| 📓 Your own notebook | Device cache | Recent answers, instant |
| 🧑💼 A librarian who looks things up for you | Resolver | Does the searching, caches results |
| 🌐 The world directory | Root servers | Know who handles .com, .uk, .example… |
| 🏷️ A country's directory | TLD (top-level domain) servers | Know who runs each name under their ending |
| ✅ The company's own receptionist | Authoritative name server | The official answer |
| ⏳ "This address is good for 5 minutes" | TTL | How long the answer may be reused |
Visual Mental Model
How It Works (Interactive Animated Flow)
One DNS Lookup
From a name to a number, desk by desk
🎯 Mission Find the IP address of coindash.example so Coin Dash can send your score.
Record Types You'll Meet
| Record | Means | Example |
|---|---|---|
| A | name → IP address (classic 4-number form) | coindash.example → 198.51.100.20 |
| AAAA | name → newer, longer IP address (IPv6, version 6) | coindash.example → 2001:db8::20 |
| CNAME | name → another name ("alias") | www.coindash.example → coindash.example |
| MX | where email for this domain goes | mail.coindash.example |
| TXT | free text, often used to prove ownership | "verify=abc123" |
Try it yourself: nslookup coindash.example or dig coindash.example (it will fail: .example is reserved for teaching).
The 4 Core Principles
- Names for people, numbers for machines. DNS is the translation layer.
- Nobody knows everything. Each server knows only who to ask next; the resolver follows the chain.
- Caching makes it fast. Most lookups are answered from a cache in ~0 ms.
- TTL is a trade-off. Long = fewer lookups; short = changes spread faster.
Trade-offs
| Choice | Upside | Downside |
|---|---|---|
| Long TTL (hours) | Fewer lookups, faster, more resilient | A server move takes hours to reach everyone |
| Short TTL (seconds–minutes) | Changes and failovers spread quickly | More lookups, more load on name servers |
| Your provider's resolver | Close and fast | Some are slow or filter results |
| A public resolver | Often fast and well run | Another company sees which names you look up |
Common Gotchas
Watch Out For
- "It's always DNS." If a site works for some people and not others after a change, suspect cached (stale) answers.
- Lower the TTL before you move servers, wait one old TTL, then move.
- DNS lookups are usually not encrypted. Your provider can see which names you look up, even when the site uses HTTPS (HyperText Transfer Protocol Secure). Newer "DNS over HTTPS" hides them.
- The domain name is not the server. One name can point to many servers, and one server can host many names.
Quick Self-Check (Restore Your Memory)
1. Which server gives the official answer for coindash.example?
Coin Dash's own authoritative name server. The root and .example servers only point the resolver toward it.
2. Why is the second lookup of a name almost instant?
The answer is cached by your device and the resolver until its TTL runs out.
3. Coin Dash moved servers two minutes ago; you still reach the old one. Why, and how could they have avoided it?
Your cached answer hasn't expired. They should have lowered the TTL well before the move, so old answers would expire within seconds.
🎬 Now Watch It Happen
2-minute episode
Ride along as a tiny question packet walking the DNS chain, then fall into the cache trap. S2 · E4 — The Address Book →