DNS Resolution
Follow a DNS query from your browser through recursive resolvers, root servers, TLD servers, and authoritative nameservers. See caching, TTLs, and record types in action.
Continue with the guided workspace
Use the paired workspace to connect this guide's mental model with live component state, visible signals, and the outcome each step or scenario is meant to prove.
The Domain Name System (DNS) translates human-readable names like example.com into the IP addresses machines use to talk to each other. Resolution is a hierarchical, cached walk: the browser asks a recursive resolver, which asks a root server, then a TLD server, then the authoritative nameserver for the domain, caching the answer at every level for the recordβs TTL.
Mental Model
DNS (Domain Name System) acts as the phonebook of the internet, translating human-readable domain names (like example.com) into machine-readable IP addresses (like 93.184.216.34).
The resolution process is a hierarchical, distributed query system:
- The Browser checks its local cache.
- The Operating System checks its hosts file and system cache.
- The query is forwarded to a Recursive Resolver (your ISP or public services like Cloudflare
1.1.1.1or Google8.8.8.8). - If the resolver doesnβt have it cached, it queries the Root Server (
.), which points it to the Top-Level Domain (TLD) Server (like.com). - The resolver queries the TLD server, which points it to the Authoritative Nameserver for the specific domain.
- The resolver gets the final record and returns it to the client, caching it at every level along the way based on its TTL (Time to Live).
Components and Why They Exist
Browser
The browser initiates hostname lookups whenever a user navigates to a domain, checking its own in-memory DNS cache before asking the operating system. Its card shows the initial local cache check and the live TTL countdown on cached IP entries.
OS DNS Client
The operating system stub resolver maintains a system-wide DNS cache and /etc/hosts table shared by all local applications. When a browser lookup misses, the OS card checks its local cache and forwards unresolved queries over the network to the Recursive Resolver.
Recursive Resolver
The recursive resolver walks the DNS hierarchy on behalf of the client, turning a single recursive request into a sequence of iterative queries so user devices do not have to chase referrals themselves. Iterative query arrows fan out from the resolver card to the Root, TLD, and Authoritative servers before the final answer is cached and returned.
Root Server (.)
The root nameserver sits at the top of the DNS hierarchy and directs resolvers toward the appropriate Top-Level Domain (TLD) registry. It inspects the domain suffix on incoming queries and returns a referral response containing the .com TLD nameserver addresses.
TLD Server (.com)
The Top-Level Domain (TLD) server maintains the delegation records for every domain registered under its extension, such as .com or .org. When queried by the recursive resolver, the TLD card returns a referral pointing to the domainβs Authoritative Nameserver IP.
Authoritative Server (ex.com)
The authoritative nameserver holds the definitive zone file (A, AAAA, CNAME, and MX records) configured by the domain owner. It answers the resolverβs final iterative query with the authoritative IP address and record TTL along a green response path.
Edge Cases and Misconceptions
- Anycast routing vs physical location: Root and TLD servers are not single physical servers in one room. They use Anycast routing, meaning the same IP address is advertised globally by multiple data centers. Routers send the query to the topologically nearest physical instance, making the root queries much faster than they appear.
- Iterative vs Recursive queries: Clients (like browsers) perform recursive queries to resolvers, meaning they expect the resolver to do all the work and return the final answer. Resolvers perform iterative queries to Root, TLD, and Authoritative servers, meaning they receive referrals and must execute each subsequent step themselves.
- CNAME lookup overhead: A CNAME (Canonical Name) record is an alias pointing to another domain name. If a domain points to a CNAME, the resolver must restart the entire resolution process for the target domain name, doubling the lookup latency.
- Negative caching: When a domain does not exist, nameservers return an
NXDOMAIN(Non-Existent Domain) response. Resolvers cache this negative response for a duration defined by the zoneβs SOA (Start of Authority) record, preventing clients from DDoS-ing nameservers with requests for nonexistent sites.
Common Questions
What is the difference between a recursive resolver and an authoritative nameserver?
A recursive resolver (usually operated by an ISP or public DNS provider like 8.8.8.8) acts as the middleman for clients. It performs the multi-step query process (root -> TLD -> authoritative) on behalf of the client and returns the final IP. An authoritative nameserver is the actual owner of the DNS zone that holds the original records (like A, CNAME, MX) and returns the definitive answers for domains in that zone.
What is DNS propagation delay, and why does it occur?
DNS propagation delay is the time it takes for updates to a DNS record to spread across the internet. When you change an IP address on an authoritative nameserver, resolver caches around the world continue serving the old IP address until their cached records' TTL (Time to Live) countdown reaches zero and they are forced to query the authoritative nameserver again.
What is the role of TTL (Time to Live) in DNS records?
TTL is a value (in seconds) set on each DNS record by the domain administrator. It specifies how long recursive resolvers, operating systems, and browsers are allowed to cache the query response locally before they must discard it and perform a fresh lookup. High TTLs reduce resolver load, while low TTLs permit rapid failover.
Why can one user see a DNS change before another user does?
Different recursive resolvers may have cached the old record at different times, so their TTL countdowns expire at different moments. A user whose resolver cache has expired will receive the new answer, while another user may keep seeing the old answer until that resolver refreshes.