dig is a flexible DNS lookup utility that performs DNS lookups and displays the answers from the queried name servers. It’s the preferred tool for DNS troubleshooting by network administrators.
Key Features
DNS record querying
DNS server testing
DNSSEC validation
Trace DNS resolution path
Reverse DNS lookups
Multiple query formats
Installation
Ubuntu (22.04/24.04)
macOS
Basic Syntax
Simple Query
Query Format
Query Types
Common Record Types
Reverse DNS Lookup
Advanced Options
Query Options
Multiple Queries
Output Control
Output Sections
Understanding dig Output
Section Explanations
Troubleshooting
Common Issues
DNS Resolution Problems
DNSSEC Validation
Response Time Issues
Advanced Use Cases
Batch Processing
DNS Server Testing
AXFR (Zone Transfer)
Best Practices
DNS Querying
Performance Testing
Quick Reference
Essential Commands
Common Options
+short: Brief output
+trace: Follow delegation chain
+dnssec: Show DNSSEC info
+noall: Turn off all display flags
+answer: Show answer section
+stats: Show statistics
+tcp: Use TCP instead of UDP
+norecurse: Disable recursion
Output Control Options
Remember:
Always specify record types when needed
Use +short for scripting
Check authoritative answers
Verify DNSSEC when required
Compare multiple DNS servers
Document query results
For detailed information, consult the man pages (man dig).