Packet Path/

DNS: The Internet's Phone Book

Enterprise Network Engineer · Module 1: Networking Fundamentals

Lesson 7 of 8

Foundations⏱ 40 min

Prerequisites: How Computers Talk: Packets, Frames, and Addresses, The OSI Model and TCP/IP: What Layers Actually Mean, TCP vs UDP and the Three-Way Handshake

What you'll be able to do: Trace a name lookup from your computer to the answer, read `dig` output like a lab report, and tell a DNS outage apart from a dead website.

Before you can call anyone, you need their number — and names are useless to the phone system. So you open a phone book, look up a name, and memorize the numbers you dial most. Now imagine the phone book is shared by billions of people, entries change every few minutes, and the book itself is spread across thousands of offices on different continents. That is the daily reality of naming on the internet — and it works so smoothly that most people never notice it exists. They only notice when it breaks: a website that loads fine for your friend but refuses to load for you, while everything else on your computer works perfectly. Same name, same internet, different answer — and the phone book is the prime suspect.

Here's the puzzle.

Scenario. Two laptops sit on the same office Wi-Fi. Laptop W loads the company portal fine; Laptop B gets "can't reach this site" — while everything else on Laptop B works. IT swears the portal server is healthy. Both owners ran the same lookup command. Your job: say which side is broken — Laptop B's helper or the name's owner — prove it with one output line, and give the one config line that fixes it.

Given artifacts. The office (hover any device for details):

Laptop W (working) — asks helper 192.168.1.1 — portal loads fine Laptop W working ✓ Laptop B (broken) — asks helper 192.168.1.9 — gets SERVFAIL Laptop B broken ✗ Helper 192.168.1.1 — the current internal resolver; answers correctly Helper 192.168.1.1 working resolver 192.168.1.9 — Laptop B's configured helper; answers SERVFAIL 192.168.1.9 decommissioned ✗ Authoritative server — the owner of portal.example.com's records; healthy Name's owner authoritative · healthy SERVFAIL via internet
Laptop W (working) — dig portal.example.com
  ; <<>> DiG 9.18.1 <<>> portal.example.com
  ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48291
  ;; QUESTION SECTION:
  ;portal.example.com.		IN	A
  ;; ANSWER SECTION:
  portal.example.com.	5	IN	A	10.0.5.20
  ;; Query time: 4 msec
  ;; SERVER: 192.168.1.1#53
Laptop B (broken) — dig portal.example.com
  ; <<>> DiG 9.18.1 <<>> portal.example.com
  ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 51733
  ;; QUESTION SECTION:
  ;portal.example.com.		IN	A
  ;; Query time: 2003 msec
  ;; SERVER: 192.168.1.9#53

Your task: Deliver three things: (1) which side is broken — Laptop B's helper (its configured resolver) or the name's owner (authoritative side); (2) the exact output line that proves it; (3) the one config line that fixes it.

Workspace: Analyze-and-answer — type your three answers below, then check the commitment box to reveal the worked answer.

Hint 1 — where to look The two outputs asked the identical question and got different verdicts. The diagnosis lives in the difference between the outputs, not inside either one alone.
Hint 2 — what to compare Compare the status: word and the SERVER: line in each output. One status word means "here is your answer"; the other means "I tried and failed."
Hint 3 — the mechanism SERVFAIL is the helper confessing it couldn't finish the job; NOERROR with an answer proves the name exists and the name's owner is fine. If the name itself were broken, both laptops would fail the same way.

☐ I've attempted this challenge and thought it through. (Checking reveals the worked answer in S7 — honor system: the page hides it until you commit.)

Checking the box reveals the worked answer in S7 below. Returning learners stay unlocked.

Names in, numbers out

DNS (the Domain Name System — the internet's phone book: the machinery that turns names you type into numbers the network can use) exists because humans remember names and networks route numbers. Your computer never asks the whole internet directly. It asks one designated helper — the resolver (the phone-book assistant your computer queries first; usually run by your office or internet provider) — and the resolver does the legwork.

At the far end of that legwork sits the authoritative server (the office that owns the records for a name and gives the final, official answer — like the phone company's own listing department). Between your resolver and the authoritative server lies a chain of referrals, and every link in that chain can fail in its own way — which is exactly why "down for me but not you" happens.

Why this matters for the challenge: the two laptops asked two different helpers about the same name — keep "helper" and "owner" as separate suspects.

The walk: helper → root → neighborhood → owner

A resolver that doesn't know the answer walks down a hierarchy, and the walk is always the same shape:

  1. Your computer → resolver: "What's the address of portal.example.com?" (This is the only step your computer ever sees.)
  2. Resolver → root server: the root server (the top of the phone book — it knows nothing about individual names, only where each neighborhood lives) answers: "Not mine — ask the .com servers."
  3. Resolver → TLD servers: the TLD (short for top-level domain — the last chunk of a name, like .com or .org; think "the neighborhood") answers: "Not mine — ask the owner of example.com."
  4. Resolver → authoritative server: the owner answers with the actual record.
  5. Resolver → your computer: the final answer, delivered in milliseconds.

Each step is a referral, not an answer — "I don't know, but they will." That design is why the system scales to billions of names: no single office holds the whole book.

Why this matters for the challenge: a SERVFAIL means this walk broke down somewhere — the status word tells you the helper gave up, and the working laptop tells you where it didn't break.

Record types: the pages of the phone book

The owner doesn't keep one kind of entry — it keeps several, each answering a different question:

TypeAnswersPlain English
A recordname → IPv4 addressThe main listing: "this name lives at this number."
AAAA recordname → IPv6 addressSame listing, for the newer, longer address format (the four A's are a mnemonic for the longer address).
CNAME recordnickname → real name"Also known as": www.example.com points at the real name, and the real name's A record gives the number.
MX recorddomain → mail server"Send this domain's email here" — the post office address, separate from the website address.
TXT recordfree-form textSticky notes on the listing — often used to prove you own the domain.

A lookup for a website usually ends at an A (or AAAA) record — sometimes after following one CNAME nickname to get there.

Why this matters for the challenge: both laptops asked for the A record — the main listing — so record type isn't the variable; the helpers are.

TTL and caching: memorizing numbers you dial a lot

No helper walks the full chain for every question — that would take seconds, every time. Instead it memorizes answers, and each answer carries a TTL (short for time to live — how many seconds the helper is allowed to remember the answer before it must ask again). A TTL of 5 means "remember this for 5 seconds"; a TTL of 3600 means "remember it for an hour."

Caching is why the internet feels instant — and why changes take time to spread. When a website moves to a new address, everyone whose helper memorized the old answer keeps going to the old address until their TTL expires. Short TTLs make changes fast but hammer the owners with questions; long TTLs are efficient but sluggish to update.

Why this matters for the challenge: Laptop W's answer came with TTL 5 — an aggressively short memory. Noteworthy, but as you'll see in the worked answer, a red herring: it still delivered a correct answer.

Reading dig and nslookup

dig output is a lab report with four parts that matter:

nslookup shows the same facts in friendlier prose ("Server:", "Address:", "Name:") — same suspects, different layout.

Why this matters for the challenge: your proof line is one of these four parts — you'll know which the moment you compare the two verdict words.

DNS over HTTPS, in one line

DNS over HTTPS (asking the phone book inside an encrypted web connection, so anyone watching the wire sees only web traffic, not your questions) exists because classic DNS questions travel in the open — readable by anyone between you and the helper. One line, as promised: it's the same phone book, asked through a sealed envelope.

Why this matters for the challenge: it doesn't change the diagnosis — a sealed envelope to a dead helper still gets no answer.

Laptopyou Resolverhelper Roottop .comTLD Ownerauthoritative Laptop asks the helper: "address of portal.example.com?" Root: "Not mine — ask the .com servers." .com: "Not mine — ask the owner's server." Owner: "portal.example.com → 10.0.5.20" Helper memorizes it (TTL countdown starts) and answers the laptop ✓ your computer only ever talks to the helper — the helper walks the chain
  1. Step 1 of 5: Your computer asks its helper (the resolver) — the only server it ever talks to directly.
  2. Step 2 of 5: The helper asks the root, which doesn't know the answer but points to .com.
  3. Step 3 of 5: The helper asks .com, which points to the name's owner (the authoritative server).
  4. Step 4 of 5: The helper asks the owner and gets the real answer: the A record.
  5. Step 5 of 5: The helper memorizes the answer until its TTL expires, then hands it to your computer.

Two lookups, one memorized answer

green = healthy/expected · red = problem packet(s) · amber = noteworthy, not faulty · untinted = context

NoTimeSourceDestinationProtocolLengthInfo
10.00010.0.0.15192.168.1.1DNS74Query A portal.example.com
20.004192.168.1.110.0.0.15DNS90Response A 10.0.5.20 TTL=5
33.00010.0.0.15192.168.1.1DNS74Query A portal.example.com
43.001192.168.1.110.0.0.15DNS90Response A 10.0.5.20 TTL=2

Fixture: hand-authored to show a DNS query/response pair followed by a cached answer with a decreasing TTL; no production data

Platform: Cisco IOS / IOS-XE

! PLAIN-ENGLISH: Tell the router which helpers to ask for name lookups (tried top-down, in order).
ip name-server 192.168.1.9
ip name-server 192.168.1.1
!
! PLAIN-ENGLISH: Let the router answer name lookups for the LAN itself (it becomes the office helper).
ip dns server

Sample output of the verification command (shown so you can read it, not configure it):

R-1# show hosts
Default domain is example.com
Name servers are 192.168.1.9, 192.168.1.1

Host                    Port  Flags      Age  Type   Address(es)
portal.example.com      -     -          0    IP     10.0.5.20

⚠️ Remove this, break that: with no ip name-server at all, the router cannot resolve a single name — ping portal.example.com fails with "unknown host" even though the whole network is healthy. ⚠️ Remove this, break that: a dead entry listed first (192.168.1.9 here) makes every lookup stall or fail before the working helper is ever tried — always put the working helper first. ⚠️ Remove this, break that: no ip domain-lookup switches the whole thing off — the router won't even attempt DNS, and every hostname becomes "unknown."

🔒 The worked answer is hidden until you commit...

Check yourself — nothing here is graded. Wrong answers are the useful ones; each explains why.

Question 1. Which record type holds a name's IPv4 address?

Question 2. Your laptop resolves every site fine. Your coworker's laptop, on the same network, gets NXDOMAIN for the same site. What is the most likely cause?

Question 3. A router can't resolve any names. Which line is faulty?

line 1: ip name-server 192.168.1.1
line 2: ip name-server 192.168.1.999
line 3: ip dns server

Question 4. A lookup returns status SERVFAIL. What does that tell you?

Question 5. A website moves to a new address. Half the office sees the new site immediately; the other half sees the old one for exactly one hour. The records use TTL 3600. What happened?

Next: Ethernet and Cabling: The Physical Layer — Names now turn into numbers — but numbers still have to travel as electricity and light. Next: the cables themselves, and why a dirty connector can quietly halve your speed.