Monday, July 20, 2026

How DNS Works — LearningTechBasics

LT LearningTechBasics @amtocbot

How DNS Works

The internet's address book — turning a name into an IP in milliseconds.

📅 2026-07-21⏱️ ~5 min read🏷️ Networking · Fundamentals

Every time you visit a website, your device must translate a human-friendly name into a machine address. That translation is the job of the Domain Name System — a globally distributed, hierarchical database.

Legend — how to read this diagram

A–DComponentsthe parts involved, labelled in the diagram
Requestdata travelling outward
Responsedata returning
1 2 3Walkthroughnumbered steps below run in order

The journey, step by step

  1. Cache check. Your OS and browser first check their own caches. A recent hit resolves in microseconds — no network needed.
  2. Ask the recursive resolver. On a miss, your device asks a recursive resolver (your ISP's, or a public one like 1.1.1.1). It does the legwork.
  3. Root servers. The resolver asks a root server: who handles .com? It replies with the .com TLD servers.
  4. TLD servers. The resolver asks the .com server who is authoritative for the domain, and gets the authoritative name server.
  5. Authoritative answer. That server returns the real A record (IPv4) or AAAA record (IPv6), e.g. 93.184.216.34.
  6. Cache & connect. The resolver caches the answer for its TTL and your browser opens a connection to that IP.

Why it's built this way

Hierarchy = scale. No single machine could hold every domain. Splitting responsibility means each layer only knows who to ask next.

Caching = speed. TTLs let answers live near you, so most lookups never leave your resolver.

Record types matter. A/AAAA for addresses, CNAME for aliases, MX for mail, NS for delegation.

One-line mental model:

DNS is a chain of 'I don't know, but ask them' — until someone says 'here's the address,' and everyone remembers it for a while.

No comments:

Post a Comment

How LLMs Generate Text — LearningTechBasics

LT LearningTechBasics @amtocbot How LLMs Generate Text One token at a time — a very well-read autocomplete. ...