# macOS — usually pre-installed
dig --version # Ubuntu / Debian
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install dnsutils # CentOS / RHEL / Fedora
-weight: 600;">sudo -weight: 500;">yum -weight: 500;">install bind-utils
# macOS — usually pre-installed
dig --version # Ubuntu / Debian
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install dnsutils # CentOS / RHEL / Fedora
-weight: 600;">sudo -weight: 500;">yum -weight: 500;">install bind-utils
# macOS — usually pre-installed
dig --version # Ubuntu / Debian
-weight: 600;">sudo -weight: 500;">apt -weight: 500;">install dnsutils # CentOS / RHEL / Fedora
-weight: 600;">sudo -weight: 500;">yum -weight: 500;">install bind-utils
dig [domain] [record_type] [options]
dig [domain] [record_type] [options]
dig [domain] [record_type] [options]
+short # Concise output (just the answer)
+trace # Full recursive trace from root down
@8.8.8.8 # Use a specific resolver
+norecurse # Query the server directly without recursion
+short # Concise output (just the answer)
+trace # Full recursive trace from root down
@8.8.8.8 # Use a specific resolver
+norecurse # Query the server directly without recursion
+short # Concise output (just the answer)
+trace # Full recursive trace from root down
@8.8.8.8 # Use a specific resolver
+norecurse # Query the server directly without recursion
┌─────────────┐ │ Root NS │ ← dig . NS │ (. zone) │ └──────┬──────┘ │ "Ask .com servers" ┌──────▼──────┐ │ TLD NS │ ← dig com NS │ (.com zone) │ └──────┬──────┘ │ "Ask Google's servers" ┌──────▼──────┐ │ Auth NS │ ← dig google.com NS │(google.com) │ └──────┬──────┘ │ "Here's the IP" ┌──────▼──────┐ │ A Record │ ← dig google.com │142.250.x.x │ └─────────────┘
┌─────────────┐ │ Root NS │ ← dig . NS │ (. zone) │ └──────┬──────┘ │ "Ask .com servers" ┌──────▼──────┐ │ TLD NS │ ← dig com NS │ (.com zone) │ └──────┬──────┘ │ "Ask Google's servers" ┌──────▼──────┐ │ Auth NS │ ← dig google.com NS │(google.com) │ └──────┬──────┘ │ "Here's the IP" ┌──────▼──────┐ │ A Record │ ← dig google.com │142.250.x.x │ └─────────────┘
┌─────────────┐ │ Root NS │ ← dig . NS │ (. zone) │ └──────┬──────┘ │ "Ask .com servers" ┌──────▼──────┐ │ TLD NS │ ← dig com NS │ (.com zone) │ └──────┬──────┘ │ "Ask Google's servers" ┌──────▼──────┐ │ Auth NS │ ← dig google.com NS │(google.com) │ └──────┬──────┘ │ "Here's the IP" ┌──────▼──────┐ │ A Record │ ← dig google.com │142.250.x.x │ └─────────────┘
;; ANSWER SECTION:
. 518400 IN NS a.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS c.root-servers.net.
...
. 518400 IN NS m.root-servers.net.
;; ANSWER SECTION:
. 518400 IN NS a.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS c.root-servers.net.
...
. 518400 IN NS m.root-servers.net.
;; ANSWER SECTION:
. 518400 IN NS a.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS c.root-servers.net.
...
. 518400 IN NS m.root-servers.net.
;; ANSWER SECTION:
com. 172800 IN NS a.gtld-servers.net.
com. 172800 IN NS b.gtld-servers.net.
...
com. 172800 IN NS m.gtld-servers.net.
;; ANSWER SECTION:
com. 172800 IN NS a.gtld-servers.net.
com. 172800 IN NS b.gtld-servers.net.
...
com. 172800 IN NS m.gtld-servers.net.
;; ANSWER SECTION:
com. 172800 IN NS a.gtld-servers.net.
com. 172800 IN NS b.gtld-servers.net.
...
com. 172800 IN NS m.gtld-servers.net.
dig google.com NS
dig google.com NS
dig google.com NS
;; ANSWER SECTION:
google.com. 21600 IN NS ns1.google.com.
google.com. 21600 IN NS ns2.google.com.
google.com. 21600 IN NS ns3.google.com.
google.com. 21600 IN NS ns4.google.com.
;; ANSWER SECTION:
google.com. 21600 IN NS ns1.google.com.
google.com. 21600 IN NS ns2.google.com.
google.com. 21600 IN NS ns3.google.com.
google.com. 21600 IN NS ns4.google.com.
;; ANSWER SECTION:
google.com. 21600 IN NS ns1.google.com.
google.com. 21600 IN NS ns2.google.com.
google.com. 21600 IN NS ns3.google.com.
google.com. 21600 IN NS ns4.google.com.
dig google.com
dig google.com
dig google.com
;; QUESTION SECTION:
;google.com. IN A ;; ANSWER SECTION:
google.com. 300 IN A 142.250.195.78 ;; Query time: 12 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; QUESTION SECTION:
;google.com. IN A ;; ANSWER SECTION:
google.com. 300 IN A 142.250.195.78 ;; Query time: 12 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; QUESTION SECTION:
;google.com. IN A ;; ANSWER SECTION:
google.com. 300 IN A 142.250.195.78 ;; Query time: 12 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
1. You type google.com ↓
2. Browser checks its DNS cache → miss ↓
3. OS checks /etc/hosts + system cache → miss ↓
4. Query sent to recursive resolver (8.8.8.8) ↓
5. Resolver asks Root NS: "Who handles .com?" ← "Ask a.gtld-servers.net" ↓
6. Resolver asks gTLD NS: "Who handles google.com?" ← "Ask ns1.google.com" ↓
7. Resolver asks ns1.google.com: "What's the A record for google.com?" ← "142.250.195.78, TTL 300" ↓
8. Resolver returns IP to your OS, caches it for 300 seconds ↓
9. Browser opens TCP connection to 142.250.195.78:443 ↓
10. TLS handshake → HTTP request → Page loads ✓
1. You type google.com ↓
2. Browser checks its DNS cache → miss ↓
3. OS checks /etc/hosts + system cache → miss ↓
4. Query sent to recursive resolver (8.8.8.8) ↓
5. Resolver asks Root NS: "Who handles .com?" ← "Ask a.gtld-servers.net" ↓
6. Resolver asks gTLD NS: "Who handles google.com?" ← "Ask ns1.google.com" ↓
7. Resolver asks ns1.google.com: "What's the A record for google.com?" ← "142.250.195.78, TTL 300" ↓
8. Resolver returns IP to your OS, caches it for 300 seconds ↓
9. Browser opens TCP connection to 142.250.195.78:443 ↓
10. TLS handshake → HTTP request → Page loads ✓
1. You type google.com ↓
2. Browser checks its DNS cache → miss ↓
3. OS checks /etc/hosts + system cache → miss ↓
4. Query sent to recursive resolver (8.8.8.8) ↓
5. Resolver asks Root NS: "Who handles .com?" ← "Ask a.gtld-servers.net" ↓
6. Resolver asks gTLD NS: "Who handles google.com?" ← "Ask ns1.google.com" ↓
7. Resolver asks ns1.google.com: "What's the A record for google.com?" ← "142.250.195.78, TTL 300" ↓
8. Resolver returns IP to your OS, caches it for 300 seconds ↓
9. Browser opens TCP connection to 142.250.195.78:443 ↓
10. TLS handshake → HTTP request → Page loads ✓
Your Device │ ▼
Recursive Resolver (8.8.8.8) │ Checks its cache first... │ If miss, walks the chain: ├──► Root NS → referral ├──► TLD NS → referral └──► Auth NS → answer ✓ Caches the result Returns to you
Your Device │ ▼
Recursive Resolver (8.8.8.8) │ Checks its cache first... │ If miss, walks the chain: ├──► Root NS → referral ├──► TLD NS → referral └──► Auth NS → answer ✓ Caches the result Returns to you
Your Device │ ▼
Recursive Resolver (8.8.8.8) │ Checks its cache first... │ If miss, walks the chain: ├──► Root NS → referral ├──► TLD NS → referral └──► Auth NS → answer ✓ Caches the result Returns to you
Root NS TTLs → ~2 days (very stable)
TLD NS TTLs → ~2 days (very stable)
Auth NS TTLs → hours (occasionally updated)
A record TTLs → seconds to hours (varies by domain)
Root NS TTLs → ~2 days (very stable)
TLD NS TTLs → ~2 days (very stable)
Auth NS TTLs → hours (occasionally updated)
A record TTLs → seconds to hours (varies by domain)
Root NS TTLs → ~2 days (very stable)
TLD NS TTLs → ~2 days (very stable)
Auth NS TTLs → hours (occasionally updated)
A record TTLs → seconds to hours (varies by domain)
8.8.8.8 → Google Public DNS
1.1.1.1 → Cloudflare DNS (fastest globally, strong privacy)
9.9.9.9 → Quad9 (security-focused, blocks malware domains)
208.67.222.222 → OpenDNS (Cisco)
8.8.8.8 → Google Public DNS
1.1.1.1 → Cloudflare DNS (fastest globally, strong privacy)
9.9.9.9 → Quad9 (security-focused, blocks malware domains)
208.67.222.222 → OpenDNS (Cisco)
8.8.8.8 → Google Public DNS
1.1.1.1 → Cloudflare DNS (fastest globally, strong privacy)
9.9.9.9 → Quad9 (security-focused, blocks malware domains)
208.67.222.222 → OpenDNS (Cisco)
dig . NS # Stage 1: Who are the root name servers?
dig com NS # Stage 2: Who manages the .com TLD?
dig google.com NS # Stage 3: Who is authoritative for google.com?
dig google.com # Stage 4: What's the actual IP address?
dig . NS # Stage 1: Who are the root name servers?
dig com NS # Stage 2: Who manages the .com TLD?
dig google.com NS # Stage 3: Who is authoritative for google.com?
dig google.com # Stage 4: What's the actual IP address?
dig . NS # Stage 1: Who are the root name servers?
dig com NS # Stage 2: Who manages the .com TLD?
dig google.com NS # Stage 3: Who is authoritative for google.com?
dig google.com # Stage 4: What's the actual IP address?
dig +trace google.com
dig +trace google.com
dig +trace google.com
DNS Resolution → ~1ms (cached) to ~100ms (fresh)
TCP Handshake → ~10–50ms
TLS Handshake → ~20–100ms
HTTP Request → ~10–50ms
Page Render → varies
DNS Resolution → ~1ms (cached) to ~100ms (fresh)
TCP Handshake → ~10–50ms
TLS Handshake → ~20–100ms
HTTP Request → ~10–50ms
Page Render → varies
DNS Resolution → ~1ms (cached) to ~100ms (fresh)
TCP Handshake → ~10–50ms
TLS Handshake → ~20–100ms
HTTP Request → ~10–50ms
Page Render → varies
# The resolution hierarchy
dig . NS # Root name servers
dig com NS # .com TLD name servers
dig google.com NS # Authoritative name servers
dig google.com # Final A record (IPv4) # Other record types
dig google.com AAAA # IPv6 address
dig google.com MX # Mail servers
dig google.com TXT # TXT records (SPF, DKIM, verification)
dig google.com CNAME # Canonical name alias # Diagnostic flags
dig +short google.com # Just the IP
dig +trace google.com # Full resolution trace from root
dig @1.1.1.1 google.com # Force a specific resolver
dig +norecurse @a.root-servers.net google.com # Direct root query
# The resolution hierarchy
dig . NS # Root name servers
dig com NS # .com TLD name servers
dig google.com NS # Authoritative name servers
dig google.com # Final A record (IPv4) # Other record types
dig google.com AAAA # IPv6 address
dig google.com MX # Mail servers
dig google.com TXT # TXT records (SPF, DKIM, verification)
dig google.com CNAME # Canonical name alias # Diagnostic flags
dig +short google.com # Just the IP
dig +trace google.com # Full resolution trace from root
dig @1.1.1.1 google.com # Force a specific resolver
dig +norecurse @a.root-servers.net google.com # Direct root query
# The resolution hierarchy
dig . NS # Root name servers
dig com NS # .com TLD name servers
dig google.com NS # Authoritative name servers
dig google.com # Final A record (IPv4) # Other record types
dig google.com AAAA # IPv6 address
dig google.com MX # Mail servers
dig google.com TXT # TXT records (SPF, DKIM, verification)
dig google.com CNAME # Canonical name alias # Diagnostic flags
dig +short google.com # Just the IP
dig +trace google.com # Full resolution trace from root
dig @1.1.1.1 google.com # Force a specific resolver
dig +norecurse @a.root-servers.net google.com # Direct root query - Distributed — No single server holds all records. The system delegates responsibility across a global hierarchy.
- Cached — Responses are stored at multiple levels to reduce latency.
- Fault-tolerant — Each layer has multiple servers so no single failure breaks name resolution. - DNS prefetching — Pre-resolving domains found in <link rel="dns-prefetch"> or in page links
- Connection pre-warming — Opening TCP/TLS connections before the user clicks
- HTTP/3 with QUIC — Reduces connection overhead after DNS - Low TTLs (60–300s) on CDN records to route users to the nearest edge node
- DNS-based load balancing — Returning different IPs based on geography or health
- DNS-over-HTTPS (DoH) — Encrypting DNS queries so ISPs can't snoop on which sites you visit - DNS is hierarchical and distributed. No single server knows everything — each layer delegates to the next.
- Root servers (. NS) point to TLD servers. There are 13 names, backed by hundreds of anycast servers.
- TLD servers (e.g., com NS) point to authoritative servers for each domain.
- Authoritative servers hold the actual records — A, MX, TXT, CNAME, etc.
- Recursive resolvers traverse the full chain on your behalf and cache results using TTLs.
- dig +trace is the fastest way to see the entire resolution chain in one command. - IANA Root Zone Database
- RFC 1034 — Domain Names: Concepts and Facilities
- Cloudflare DNS Learning Center
- DNS Checker — Global Propagation Tool
- dns.google — Google's DNS over HTTPS UI