Drill: Debug DNS with dig¶
Goal¶
Use dig to perform DNS lookups, trace delegation chains, query specific servers, and perform reverse lookups.
Setup¶
- Linux system with dig installed (part of
dnsutilsorbind-utils) - Network access to DNS servers
Commands¶
Basic lookup:
Get just the answer (short form):
Query a specific DNS server:
Trace the full delegation chain from root:
Look up specific record types:
Reverse DNS lookup:
Check if a record is cached (show TTL):
Query with no recursion (test authoritative server):
What to Look For¶
NOERRORstatus with empty answer section means the name exists but has no records of that typeNXDOMAINmeans the domain does not exist at allSERVFAILoften indicates DNSSEC validation failure or upstream issues- TTL values tell you how long until the record expires from cache
+traceshows each delegation step from root to authoritative server
Common Mistakes¶
- Not comparing results between local resolver and public DNS (caching differences)
- Forgetting that
+tracebypasses local cache and queries from root - Confusing CNAME chains with the actual A/AAAA answer
- Not checking the AUTHORITY section for NS delegation information
Cleanup¶
No cleanup needed. dig is a read-only query tool.