Every web request starts with DNS. Understanding the resolution process helps you optimize performance and debug network issues.
The Resolution Flow
- Browser Cache: Checks if it already knows the IP (TTL-based)
- OS Cache: Checks the operating system's DNS cache
- Router Cache: Some routers cache DNS responses
- ISP Recursive Resolver: Your ISP's DNS server
- Root Name Server: Directs to TLD server (.com, .org)
- TLD Name Server: Directs to authoritative server
- Authoritative Name Server: Returns the actual IP address
DNS Record Types
| Type | Purpose | Example |
|---|---|---|
| A | IPv4 address | example.com → 93.184.216.34 |
| AAAA | IPv6 address | example.com → 2606:2800:220:1:... |
| CNAME | Alias to another domain | www.example.com → example.com |
| MX | Mail server | example.com → mail.example.com |
| TXT | Text data (SPF, DKIM) | v=spf1 include:_spf.google.com |
| NS | Name server | example.com → ns1.cloudflare.com |
Performance Optimization
TTL (Time to Live)
Each DNS record has a TTL in seconds. Lower TTL = more DNS lookups but faster failover. Higher TTL = fewer lookups but slower propagation of changes.
Common Issues
- DNS propagation delay: After changing records, old values persist in caches until TTL expires
- DNS over HTTPS (DoH): Encrypts DNS queries. Chrome and Firefox support it. Prevents ISP snooping.
- Split-horizon DNS: Different answers for internal vs external queries. Common in corporate networks.