Skip to content

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.

  1. Your device checks its cache (recent answers), then asks a resolver.
  2. The resolver walks the chain: root server → top-level domain server (".example") → the domain's own authoritative server, which gives the official answer.
  3. 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 lifeIn DNSWhat it does
📓 Your own notebookDevice cacheRecent answers, instant
🧑‍💼 A librarian who looks things up for youResolverDoes the searching, caches results
🌐 The world directoryRoot serversKnow who handles .com, .uk, .example…
🏷️ A country's directoryTLD (top-level domain) serversKnow who runs each name under their ending
✅ The company's own receptionistAuthoritative name serverThe official answer
⏳ "This address is good for 5 minutes"TTLHow long the answer may be reused

Visual Mental Model ​

A DNS lookup: laptop cache, then the resolver asks the root server, the .example servers and Coin Dash's own name server, and caches the answer for 300 seconds

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.
START💻Your laptopchecks its own cacheNEARBY🧑‍💼Resolversearches for you“.”🌐Root serverknows every endingTLD🏷️.example serversknow who’s in chargeAUTH✅Coin Dash’s serverthe official answercoindash.example?ask .examplenext deskask Coin Dash198.51.100.20 · 300 scached answer

Record Types You'll Meet ​

RecordMeansExample
Aname → IP address (classic 4-number form)coindash.example → 198.51.100.20
AAAAname → newer, longer IP address (IPv6, version 6)coindash.example → 2001:db8::20
CNAMEname → another name ("alias")www.coindash.example → coindash.example
MXwhere email for this domain goesmail.coindash.example
TXTfree 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 ​

  1. Names for people, numbers for machines. DNS is the translation layer.
  2. Nobody knows everything. Each server knows only who to ask next; the resolver follows the chain.
  3. Caching makes it fast. Most lookups are answered from a cache in ~0 ms.
  4. TTL is a trade-off. Long = fewer lookups; short = changes spread faster.

Trade-offs ​

ChoiceUpsideDownside
Long TTL (hours)Fewer lookups, faster, more resilientA server move takes hours to reach everyone
Short TTL (seconds–minutes)Changes and failovers spread quicklyMore lookups, more load on name servers
Your provider's resolverClose and fastSome are slow or filter results
A public resolverOften fast and well runAnother 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 →

Built for clear thinking and fast 2-minute refreshers.