"It's Not DNS." "It Was DNS."
There's a famous developer joke that goes like this:
It's not DNS.
There's no way it's DNS.
It was DNS.
If you've ever had a site that works for you but not for your friend, or a "fix" that somehow hasn't appeared hours later, you've probably met DNS without realizing it. It's one of those things every developer uses every single day, and very few can explain.
So let's fix that. By the end of this post, you'll know exactly what happens in the half-second between typing a website name and seeing a page.
In Part 6 we covered rate limiting. Today we go all the way back to the very first step of every request in this series: how does your device even know where to go?
The Problem: Computers Don't Do Names
Here's the thing. You think of websites by name: google.com, github.com. Easy for humans to remember.
But computers find each other using numbers, called IP addresses, like 142.250.190.78. Every server on the internet has one. Numbers are great for machines and terrible for people. Imagine having to memorize a different string of digits for every site you visit.
So the internet needs a translator, something that takes a friendly name and hands back the number. That translator is DNS, the Domain Name System.
The Phone Book Analogy (and Where It Breaks)
The classic way to explain DNS: it's the internet's phone book. You look up a name, you get a number.
That's a good start. But the real thing is more interesting, because there's no single giant phone book sitting somewhere. If there were, it would be slow, easy to break, and impossible to keep up to date.
Instead, DNS is more like a chain of helpful people who each know one piece of the answer. Imagine asking for directions to a specific house in a city you don't know:
- Someone points you to the right country
- Another points you to the right city
- Another points you to the right street
- And the last person points you to the exact house
Nobody knows everything. Everybody knows who to ask next. That's DNS.
The Cast of Characters
Here are the players in the chain, in plain language.
Your browser and operating system (the cache). Before asking anyone, your own device checks its memory: "Have I looked this up recently?" If yes, done, instantly. (Hello again, caching from Part 5.)
The recursive resolver. This is the helpful assistant who does the legwork for you. It's usually run by your internet provider, or a public service like Google's 8.8.8.8 or Cloudflare's 1.1.1.1. You ask it one question, and it goes off and chases the answer through the chain, then brings it back. It also remembers answers, so it can reply instantly next time.
Root servers. The very top of the hierarchy. They don't know where github.com lives, but they know who handles every ending, like .com, .org, or .ke. They're the "which country?" person.
TLD servers (top-level domain). These handle one ending each. The .com servers know who is in charge of github.com. The .ke servers know who runs a Kenyan domain. They're the "which city?" person.
Authoritative name servers. The final stop. These are the servers that actually hold the real records for a specific domain and give the definitive answer: "Yes, github.com lives at this exact address." They're the "this exact house" person.
What Happens When You Type a Website Name
Let's follow one lookup, step by step. You type example.com and press Enter.
- Your browser checks its own memory. Not there.
- Your operating system checks its memory. Still not there.
- Your device asks the recursive resolver: "Where is
example.com?" - The resolver checks its memory. Let's say it's the first lookup, so no luck.
- The resolver asks a root server: "Who handles
.com?" The root replies: "Ask the.comservers, here's their address." - The resolver asks a
.comserver: "Who handlesexample.com?" It replies: "Ask this authoritative server." - The resolver asks the authoritative server: "What's the address for
example.com?" It replies with the IP address. - The resolver saves the answer for next time and sends it back to you.
- Your browser now connects to that IP address and the page begins to load.
That whole journey usually takes a few dozen milliseconds. And the next lookup? Much faster, because the answer is now remembered at several levels.
It sounds like a lot, but remember: most of the time, steps 1 to 4 catch the answer and the long chain never even runs. Caching does the heavy lifting.
The Records: What DNS Actually Stores
When we say the authoritative server "holds the records," what's in them? DNS stores different record types, each answering a different question. These are the ones you'll actually meet:
- A record: maps a name to an IPv4 address. "
example.comis at93.184.216.34." The most common record. - AAAA record: same thing, but for IPv6 addresses (the newer, longer kind).
- CNAME record: an alias. It says "this name is really just another name." For example,
www.example.comcan point toexample.com, so you only manage the real address in one place. - MX record: says where to deliver email for the domain. Without it, nobody can email you at that address.
- TXT record: a free-form note. Used a lot for verification and security, like proving you own a domain or setting up email anti-spoofing rules.
- NS record: says which name servers are in charge of the domain.
A handy mental shortcut: A = "where's the website?", MX = "where's the email?", CNAME = "same as that other name", TXT = "a note proving something."
TTL: The Reason "It Hasn't Updated Yet"
Remember TTL from the caching post? DNS uses it too. Every DNS record has a TTL (time to live), a number of seconds that tells everyone "you may remember this answer for this long before checking again."
This is the secret behind the most confusing DNS experience: "I changed it, but nothing happened."
When you change a record, the new answer exists on the authoritative server right away. But every resolver and device that already remembered the old answer keeps using it until its TTL runs out. So some people see the new site while others still see the old one, for minutes or even hours.
People call this "DNS propagation," and it makes it sound like your change is slowly travelling across the internet. It isn't, really. Nothing is being pushed anywhere. It's just a lot of caches slowly expiring on their own schedules.
A very practical trick: before a planned change (like moving to a new server), lower the TTL a day or so in advance, say to 300 seconds. Then when you make the real switch, old answers expire in about five minutes instead of a day. Afterwards, you can raise it again.
DNS Is Secretly Running Your Whole Infrastructure
Here's where this connects to the rest of the series. DNS isn't just a lookup tool, it's often a control panel for traffic:
- CDNs (Part 1): when you use a CDN, a lookup for your domain often returns the address of the nearest edge server, different for users in different places. That's DNS doing geographic routing.
- Load balancing (Part 2): DNS can hand out several addresses for one name, spreading visitors across servers. This is called DNS round robin, a very simple form of load balancing.
- Failover: some DNS services check if a server is healthy, and quietly stop returning its address if it goes down.
- Reverse proxies and gateways (Parts 3 and 4): your domain's A record usually points to the proxy or gateway, which then routes the rest.
So when you point your domain at Cloudflare or a load balancer, you're really just editing a few DNS records, and everything else follows from that.
What Goes Wrong (and How to Spot It)
"It works for me but not for them." Classic stale-cache situation. Your resolver has the new record, theirs still has the old one. Usually just time and TTL.
Typos in records. One wrong digit in an IP or a missing dot in a CNAME, and the site vanishes. Always double-check.
A CNAME at the root domain. The bare domain (example.com) generally can't be a CNAME, because it also has to hold other records like NS and MX. Many providers offer a workaround, often called "ALIAS" or "flattening."
Forgetting email records. You move your website and accidentally delete the MX records. The site works great, but nobody's email arrives. Ouch.
Expired domain. The domain registration lapses, and everything quietly stops resolving. Turn on auto-renew.
Long TTL, urgent change. You set a 24-hour TTL, then need to move servers right now. This is why the "lower the TTL beforehand" trick matters.
Your DNS Detective Kit
You can look at DNS yourself, right from a terminal. Two tools to know:
# Ask for a site's address dig example.com # Just the short answer dig +short example.com # Ask for a specific record type (like email servers) dig MX example.com # Ask a specific resolver, to compare answers dig @8.8.8.8 example.com dig @1.1.1.1 example.com If you're on Windows, nslookup example.com does a similar job.
A great debugging move: ask two different resolvers the same question. If they give different answers, you've found a stale cache, and you can stop blaming your code. Also look at the TTL number in the answer. It counts down, and tells you how long until that cached answer expires.
A Quick Word on Safety
Because DNS is trusted by everything, attackers love to tamper with it. In DNS spoofing (or cache poisoning), a fake answer is slipped in so you land on a lookalike page. Two protections you'll hear about:
- DNSSEC: adds digital signatures to DNS answers, so a resolver can check they're genuine
- DNS over HTTPS (DoH): encrypts your lookups, so people on the same network can't see or tamper with which sites you ask for
You don't need the details yet. Just know that DNS was built in a more trusting era, and these are the modern safety belts.
How to Set Up DNS for a New Site (A Simple Checklist)
Same spirit as the earlier checklists. When you launch a site, walk through these questions:
- Where does the site live? Get the IP address (or the hostname your host gives you).
- Point the root domain. Create an A record (or ALIAS) for
example.com. - Handle
www. Add a CNAME fromwwwto the root domain, and decide which one is the "main" version. - Set up email. Add the MX records your email provider gives you, plus any TXT records for verification and spam protection.
- Choose sensible TTLs. Around 300 to 3600 seconds is common. Go lower before big changes.
- Verify. Use
digagainst a couple of resolvers to confirm the answers. - Protect the domain. Turn on auto-renew and lock it so it can't be transferred by accident.
Where, root, www, email, TTL, verify, protect. Seven questions, and you're ready to launch.
Putting the Series Together
Look at how DNS ties everything so far into one story:
- DNS (this post): turns a name into an address, the very first step
- CDN (Part 1): answers from a server near you
- Load balancer (Part 2): spreads visitors across servers
- Reverse proxy (Part 3): stands guard in front of the servers
- API gateway (Part 4): one smart front door
- Caching (Part 5): remembers answers to save work
- Rate limiting (Part 6): keeps things fair
And notice that DNS itself is just caching all the way down: your browser, your OS, your resolver, each one remembering to save a trip. The whole internet is held together by clever remembering.
What to Take Away
- DNS turns names into numbers, because humans like names and machines need IP addresses.
- It's a chain, not one big book: your device, the resolver, the root, the TLD, then the authoritative server.
- Caching makes it fast, so the long chain rarely runs in full.
- Know your records: A (website), AAAA (IPv6), CNAME (alias), MX (email), TXT (notes and proof), NS (who's in charge).
- TTL explains "propagation." Nothing is travelling. Old answers are just expiring. Lower the TTL before big changes.
- DNS often controls routing, powering CDNs, load balancing, and failover.
- Debug with
dig, and compare two resolvers.
So the next time someone says "it's probably DNS," don't roll your eyes. They might just be right, and now you know exactly where to look.
Next in this series: HTTPS and the TLS handshake, or how two strangers on the internet agree on a secret in public without anyone else learning it.
What's the worst DNS mistake you've made? Tell me in the comments, I promise not to judge.

