How DNS Works: The Internet's Phone Book

Every time you type a website name like techtoday.space into your browser, your computer performs a tiny miracle: it translates those friendly words into a numerical address your network actually understands. The system that does this is called the Domain Name System (DNS), and it handles trillions of queries a day without most of us ever noticing it exists. Until it breaks, that is. Let's pull back the curtain.

Why the Internet needs a phone book

Computers talk to each other using IP addresses — strings of numbers like 104.21.64.1 (IPv4) or long hexadecimal strings (IPv6). These are great for machines and terrible for humans. Imagine trying to remember the number for every website you visit, the way phone numbers used to work.

DNS solves exactly this problem. It is a global, distributed directory that maps domain names (human-readable) to IP addresses (machine-usable). When you type a URL, your device asks DNS, "What's the address for this name?" — and DNS answers in milliseconds. It is the phone book of the internet, except instead of one giant book, it's a worldwide network of cooperating servers.

The lookup journey: what happens in milliseconds

A single lookup is actually a relay race between several players. Here's the journey when you visit a site your device hasn't seen before:

  1. Your browser checks its own cache. Browsers remember recent lookups, so repeat visits skip the whole process.
  2. Your operating system checks its cache. If the browser missed, your device (Windows, macOS, Android, iOS) may still have the answer stored.
  3. The recursive resolver takes over. This is the DNS server your network uses — usually run by your ISP, or a public one like Google (8.8.8.8) or Cloudflare (1.1.1.1). Its job is to hunt down the answer on your behalf, asking other servers until it finds it.
  4. Root servers get the first question. The resolver asks one of the internet's 13 root server identities (named a.root-servers.net through m.root-servers.net). These don't know individual website addresses — they simply answer, "For .com names, talk to these servers." A historical quirk: there are exactly 13 because early DNS responses had to fit inside a 512-byte packet. In reality, each of those 13 identities is replicated through anycast routing across hundreds or even thousands of physical machines worldwide, run by 12 independent organizations including NASA, ICANN, and RIPE NCC.
  5. TLD servers narrow it down. The resolver asks the servers responsible for the top-level domain (.com, .org, .pk, and so on), which reply with the authoritative servers for the specific domain.
  6. The authoritative nameserver gives the final answer. This is the server that actually holds the domain's records (usually managed by the website's hosting provider or DNS host). It returns the IP address, and your browser finally connects.

The whole chain typically finishes in under a tenth of a second — and the resolver caches the answer so the next visitor gets it instantly.

The main DNS record types, explained

An authoritative nameserver stores different record types, each serving a distinct purpose. Here are the five you'll encounter most:

Record What it maps Everyday example
A Domain name → IPv4 address example.com → 93.184.216.34
AAAA Domain name → IPv6 address example.com → 2606:2800:220:1:…
CNAME One name → another name (alias) www.example.com → example.com
MX Domain → mail servers Tells email where to deliver @example.com mail
TXT Arbitrary text notes Used for spam prevention (SPF, DKIM) and domain verification

A few more exist — like NS records, which say "this server is authoritative for this domain" — but the five above cover nearly everything an everyday user needs to understand.

Caching, TTL, and "propagation"

Caching is what makes DNS fast, but it also causes one of the most confusing phenomena on the internet: propagation delay.

Every DNS record carries a Time-To-Live (TTL) — a number of seconds telling resolvers how long they're allowed to remember the answer. Common TTLs range from a few minutes (300 seconds) to an hour (3,600 seconds) or even a full day (86,400 seconds). Short TTLs mean changes spread quickly but generate more queries; long TTLs mean faster lookups but slower updates.

When a website owner moves their site to a new server, they update their DNS records. But resolvers worldwide keep serving the old cached address until each one's TTL expires. That's what people mean by "waiting for DNS to propagate" — there's no single switch being flipped. It's thousands of caches independently expiring, one by one, which is why a site change can appear instant for one person and take hours for another.

DNS security: DNSSEC, DoH, and DoT

Classic DNS was designed in the internet's trusting early days, and it has two real weaknesses: queries travel unencrypted, and answers aren't authenticated. Three technologies fix different halves of the problem:

  • DNSSEC (DNS Security Extensions) adds cryptographic signatures to DNS records. A validating resolver can confirm the answer genuinely came from the domain's authoritative server and wasn't tampered with in transit. This defeats cache poisoning attacks, where an attacker injects fake answers. Note: DNSSEC verifies authenticity — it does not encrypt your queries, so it doesn't hide which sites you visit.
  • DNS over HTTPS (DoH) wraps your DNS queries in the same encryption as normal web traffic (port 443). Nobody on your network path — the coffee-shop Wi-Fi operator, for example — can read which domains you're asking about. Firefox and Chrome support it natively.
  • DNS over TLS (DoT) does the same job but over a dedicated encrypted channel (port 853), which makes it easier for network administrators to manage and monitor.

The key point: DoH/DoT protect the link between you and your resolver (privacy from snoops on the path), while DNSSEC protects the data itself (authenticity against forgery). They're complementary, and neither replaces the need to use a resolver you actually trust. These concepts matter for everyone online — for the basics of staying safe, see our guide to cybersecurity basics everyone should know.

"This site can't be reached": fixing DNS problems

A surprising number of "the internet is down" moments are actually DNS problems. Your connection is fine; your device just can't translate names into addresses. Here's how to diagnose and fix it:

  • First, check the basics. Is it one site or every site? If only one site fails, the problem is probably theirs, not yours. If every site fails, DNS (or your connection) is the suspect.
  • Restart your router. Home routers run tiny DNS caches that occasionally get stuck. A reboot clears them.
  • Flush your device's DNS cache. On Windows, run ipconfig /flushdns in Command Prompt. On macOS, use sudo dscacheutil -flushcache in Terminal. On Android/iOS, toggling airplane mode on and off usually does the trick.
  • Try a public resolver. If your ISP's DNS is flaky, switch to Cloudflare's 1.1.1.1 or Google's 8.8.8.8 in your network settings. This single change fixes a remarkable number of mysterious browsing issues — and often makes lookups slightly faster.
  • Check for broader outages. Sites like Downdetector will tell you if a major DNS provider is having a bad day.
  • Wait out propagation. If a site owner just moved servers, nobody can rush the TTL clocks. Give it a few hours.

DNS also underpins how other technologies reach you — for instance, how 5G changes connectivity still relies on the same lookup system to connect your phone to the right servers.

Why this matters more than ever

DNS is quietly becoming one of the internet's most contested battlegrounds. Encrypted DNS (DoH/DoT) is a genuine privacy win against snooping ISPs and public Wi-Fi eavesdroppers, but it also shifts power toward whichever resolver you choose — often a giant tech company. Meanwhile, DNS-based censorship (blocking lookups for forbidden sites) is one of the simplest tools governments use, which is exactly why encrypted DNS has become politically controversial in some countries.

For the average person, though, the practical lessons are simple: understand that DNS is a lookup, not a connection; know that "propagation" just means waiting for caches to expire; and keep 1.1.1.1 in your back pocket for the day your ISP's DNS lets you down.

Takeaway checklist

  • DNS translates domain names into IP addresses — it's the internet's phone book, handling trillions of lookups daily.
  • A lookup is a relay race: browser cache → OS cache → recursive resolver → root servers → TLD servers → authoritative nameserver.
  • Know your record types: A (IPv4), AAAA (IPv6), CNAME (alias), MX (email), TXT (verification/spam settings).
  • Propagation = caches expiring. There's no global switch; TTL values (minutes to a day) control how fast changes spread.
  • DNSSEC verifies answers (authenticity); DoH/DoT encrypt queries (privacy). They solve different problems and work best together.
  • When sites won't load: flush your DNS cache, restart your router, and try switching to 1.1.1.1 or 8.8.8.8.
  • Your resolver sees everything you look up — pick one you trust, whether that's your ISP's, Google's, Cloudflare's, or another provider.

Hamza

Founder & Editor, TechToday

Hamza is the founder and editor of TechToday. Hamza writes about artificial intelligence, computing, security and the technology shaping everyday life, with a focus on explaining complex ideas in plain, honest language — clear answers for curious readers, without the hype.