Last Updated: May 1, 2025
DNS Resolution Process
1. Browser cacheCheck local DNS cache (chrome://net-internals/#dns)
2. OS cacheCheck operating system resolver cache (systemd-resolved, nscd)
3. Recursive resolverQuery configured DNS server (ISP, 8.8.8.8, 1.1.1.1)
4. Root nameserversResolver asks root for .com/.org/.net TLD server
5. TLD nameserverTLD server returns authoritative nameserver for domain
6. Authoritative NSReturns actual record (A, CNAME, etc.) with TTL
7. Cached resultResolver caches answer for TTL duration and returns to client
DNS Record Types
| Item | Description |
|---|---|
A | Maps domain to IPv4 address (example.com → 93.184.216.34) |
AAAA | Maps domain to IPv6 address (Quad-A record) |
CNAME | Alias — maps name to another domain name (canonical name) |
MX | Mail exchanger — specifies mail server + priority for domain |
TXT | Arbitrary text — used for SPF, DKIM, DMARC, domain verification |
NS | Authoritative nameserver for the domain |
SOA | Start of Authority — admin email, serial, refresh/retry timers |
PTR | Reverse DNS — maps IP to domain name (in-addr.arpa) |
SRV | Service record — defines host/port for specific services |
CAA | Certification Authority Authorization — restricts TLS issuers |
dig Commands
dig example.comBasic A record lookup
dig example.com AAAAQuery IPv6 address
dig example.com MXQuery mail servers with priority
dig example.com ANYQuery all record types (often blocked)
dig +short example.comCompact output — just the answer
dig +trace example.comTrace full delegation path from root
dig -x 8.8.8.8Reverse DNS lookup (PTR record)
dig @1.1.1.1 example.comQuery a specific DNS resolver
dig example.com +noall +answerShow only answer section
TTL & Caching
| Item | Description |
|---|---|
TTL (Time To Live) | How long a resolver can cache a record (seconds) |
Low TTL (60-300s) | Use for records that change often (failover, DNS migration) |
High TTL (3600-86400s) | Use for stable records — reduces DNS query load |
Negative caching | Caching the 'no such record' response (NXDOMAIN, SOA MINIMUM) |
Propagation delay | Time for DNS changes to reach all resolvers = old TTL value |
Flush DNS cache | macOS: dscacheutil -flushcache; Linux: resolvectl flush-caches |
Pro Tip: Use `dig +short` for script-friendly output. Always check propagation with `dig @8.8.8.8` (Google DNS) vs `dig @1.1.1.1` (Cloudflare).