Date created: Monday, June 24, 2019 9:12:44 AM. Last modified: Friday, November 24, 2023 6:02:38 PM

'dig' - Notes


sudo yum install bind-utils
sudo apt-get install dnsutil
sudo apk add bind-tools


Query for a specific record type or types:

dig A
dig AAAA
dig MX
dig NS
dig SOA
dig TXT
dig A AAAA MX NS TXT # Multiple types works on Linux but not on Mac


Query for all record types:

dig all


Suppress all output with +noall and then enable only the query response output with +answer, dig defaults to A record type queries:

dig +noall +answer
dig +noall +answer MX


Only print the record value each record returned:

dig +short AAAA
dig +short -x


Trace the DNS query from the DNS root servers down:

dig -x +trace


Perform a reverse DNS lookup:

dig -x +short


Query against a specific DNS server:

dig @


Dig using a specific port:

dig @localhost -p 53



# Get the zone signing key (record 256) and key signing key (record 257) for a domain
dig DNSKEY @ -p 5353

# Get the hash of the DNSKEY
dig DS @ -p 5353

# Get a record under this domain
dig AAAA @ -p 5353

# Get the signature of the RRset under this domain (made with the ZSK) which contains the previous AAAA record (an others):
dig RRSIG @ -p 5353


Previous page: 'dd' Notes
Next page: 'find' - Notes