| name | dns-and-domains |
| description | Use when working with DNS records, propagation debugging, or domain routing |
DNS & Domains
Debugging DNS
dig example.com
dig example.com A
dig example.com AAAA
dig example.com CNAME
dig example.com MX
dig example.com TXT
dig example.com NS
dig @8.8.8.8 example.com
dig example.com NS
dig @<nameserver> example.com
dig -x 1.2.3.4
Common DNS Issues
| Symptom | Cause | Fix |
|---|
| NXDOMAIN | Record doesn't exist | Create the record |
| Old IP after update | TTL not expired yet | Wait, or lower TTL before changes |
| Works on some networks, not others | Propagation still in progress | Wait up to 48h |
| CNAME conflict | CNAME at root/apex (not allowed) | Use ALIAS/ANAME record instead |
| SSL cert error after DNS change | Old IP cached | Flush local DNS cache |
Propagation Checking
dig @8.8.8.8 example.com
dig @1.1.1.1 example.com
dig @9.9.9.9 example.com
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
sudo systemd-resolve --flush-caches
ipconfig /flushdns
DNS Record Types Quick Reference
| Type | Use |
|---|
A | Maps hostname → IPv4 address |
AAAA | Maps hostname → IPv6 address |
CNAME | Alias of another hostname (not at root) |
MX | Mail server for the domain |
TXT | Text data — SPF, DKIM, verification tokens |
NS | Nameservers for the domain |
SOA | Start of authority — zone metadata |
PTR | Reverse DNS (IP → hostname) |
TTL Strategy
- Before making changes: lower TTL to 300s (5 min) — wait for old TTL to expire first
- After changes are confirmed: raise TTL back to 3600s (1h) or higher
- During incidents: low TTL allows fast rollback