How DNS Works
The internet's address book — turning a name into an IP in milliseconds.
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
The journey, step by step
- Cache check. Your OS and browser first check their own caches. A recent hit resolves in microseconds — no network needed.
- 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. - Root servers. The resolver asks a root server: who handles
.com? It replies with the.comTLD servers. - TLD servers. The resolver asks the
.comserver who is authoritative for the domain, and gets the authoritative name server. - Authoritative answer. That server returns the real A record (IPv4) or AAAA record (IPv6), e.g.
93.184.216.34. - 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.
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