You type google.com in your browser. Your computer has no idea where that is. It needs an IP address. Hereβs how it finds one in about 20 milliseconds.
Step 1: Browser cache
Your browser checks its own DNS cache first. If you visited google.com in the last few minutes, the IP is already cached. Done in microseconds.
Chrome: chrome://net-internals/#dns
Firefox: about:networking#dns
Step 2: OS cache
If the browser doesnβt have it, it asks the operating system. Your OS maintains its own DNS cache.
# macOS: see cached entries
sudo dscacheutil -cachedump
# Windows:
ipconfig /displaydns
# Linux:
systemd-resolve --statistics
Step 3: Router cache
If the OS doesnβt have it, the query goes to your router (usually 192.168.1.1). Most routers cache DNS responses too.
Step 4: ISPβs recursive resolver
If nobody in your local chain has the answer, the query goes to your ISPβs DNS resolver (or whatever you configured β 8.8.8.8 for Google, 1.1.1.1 for Cloudflare).
This is where the real work happens. The recursive resolverβs job is to find the answer by asking a chain of authoritative servers.
Step 5: Root nameservers
The resolver asks one of the 13 root nameserver clusters: βWhere is google.com?β
The root server doesnβt know google.comβs IP. But it knows whoβs responsible for .com domains:
Response: βI donβt know, but ask the .com TLD servers at these addresses.β
Step 6: TLD nameservers
The resolver asks the .com TLD (Top-Level Domain) server: βWhere is google.com?β
The TLD server doesnβt know the IP either. But it knows which nameservers are authoritative for google.com:
Response: βI donβt know, but google.comβs nameservers are ns1.google.com at 216.239.32.10.β
Step 7: Authoritative nameserver
The resolver asks Googleβs nameserver: βWhatβs the IP for google.com?β
Response: β142.250.80.46. TTL: 300 seconds.β
Finally, an actual answer.
Step 8: Response chain
The answer flows back:
- Googleβs nameserver β recursive resolver
- Recursive resolver caches it (for 300 seconds, per the TTL)
- Recursive resolver β your OS
- OS caches it β your browser
- Browser caches it β makes the HTTP connection to 142.250.80.46
The full journey
Browser cache β miss
OS cache β miss
Router cache β miss
ISP resolver β miss
βββ Ask root server: "where is .com?" β TLD addresses
βββ Ask .com TLD: "where is google.com?" β NS addresses
βββ Ask google NS: "IP for google.com?" β 142.250.80.46
Response cached at every level
Browser connects to 142.250.80.46
Total time: 20-100ms for a cold lookup. <1ms for a cached one.
Why TTL matters
TTL (Time To Live) tells caches how long to keep the answer. Google uses 300 seconds (5 minutes). If youβre migrating servers and change your DNS, it can take up to the TTL for everyone to see the new IP.
βIt takes 24-48 hours for DNS to propagateβ is mostly a myth. It takes as long as the old TTL. If your TTL was 86400 (24 hours), then yes, it takes up to 24 hours. If it was 300, it takes 5 minutes.
Pro tip: lower your TTL to 60 seconds a day before a migration, then change the IP. Propagation in minutes, not hours.
DNS record types
- A: Domain β IPv4 address (
google.com β 142.250.80.46) - AAAA: Domain β IPv6 address
- CNAME: Domain β another domain (
www.google.com β google.com) - MX: Domain β mail server (
google.com β smtp.google.com) - TXT: Arbitrary text (used for email verification, SSL validation)
- NS: Domain β nameserver
The one-sentence summary
DNS is a hierarchical lookup: your browser asks your OS, which asks your router, which asks your ISP, which asks root β TLD β authoritative nameservers, and the answer gets cached at every level on the way back.
Related: What is DNS? Β· DNS Resolution Failed β fix Β· How HTTPS Keeps Your Data Safe