dig (Domain Information Groper) is the go-to DNS lookup utility for system administrators and network engineers. It queries DNS servers for various record types and provides detailed responses, making it essential for troubleshooting DNS issues, verifying configurations, and understanding DNS propagation.
📑 Table of Contents
Key Features
- Flexible Queries – Query any DNS record type (A, AAAA, MX, TXT, etc.)
- Detailed Output – Complete DNS response information
- Server Selection – Query specific DNS servers
- Reverse Lookups – PTR record queries
Installation
sudo apt install dnsutils # Debian/Ubuntu
sudo dnf install bind-utils # Fedora/RHEL
Basic Usage
# Basic A record lookup
dig example.com
# Query specific record type
dig example.com MX
dig example.com TXT
dig example.com AAAA
# Query specific DNS server
dig @8.8.8.8 example.com
# Short answer only
dig +short example.com
# Reverse DNS lookup
dig -x 8.8.8.8
# Trace delegation path
dig +trace example.com
Was this article helpful?