The Query Chain
When you type a URL into your browser, a cascade of lookups happens in milliseconds. Let's trace the path.
Browser Cache
Your browser first checks its own internal cache. Chrome stores DNS entries for about 60 seconds by default.
OS Resolver
If the browser cache misses, the OS resolver kicks in. On Linux, this is typically systemd-resolved or the classic /etc/resolv.conf chain.
# Check what your system is using
cat /etc/resolv.conf
# Query a specific nameserver
dig @8.8.8.8 example.com
Recursive Resolver
Your ISP (or Cloudflare 1.1.1.1, Google 8.8.8.8) acts as a recursive resolver. It does the heavy lifting:
- Asks root nameservers for
.com - Asks
.comTLD servers forexample.com - Asks the authoritative nameserver for the A record
- Caches and returns the result
Record Types
| Type | Purpose | Example |
|---|---|---|
| A | IPv4 address | 93.184.216.34 |
| AAAA | IPv6 address | 2606:2800:220:1:: |
| CNAME | Alias to another domain | www → example.com |
| MX | Mail server | mail.example.com |
| TXT | Arbitrary text (SPF, DKIM) | v=spf1 include:... |
Debugging
When things go wrong, dig is your best friend:
# Full trace
dig +trace example.com
# Check specific record type
dig example.com MX
# Short answer only
dig +short example.com
DNS is one of those things that "just works" until it doesn't. And when it doesn't, everything breaks.