How to use "dig" utility to debug DNS This note was created on 2024-04-02 This note was last edited on 2024-04-24 === Usage === Check MX record for "example.com": $ dig example.com mx Perform a DNS lookup for the A records of "example.com" and display only answer section in short format: $ dig example.com a +short Perform a DNS lookup for the A (IPv4 address) records of "example.com" and display only the answer section: $ dig example.com a +noall +answer Check CNAME record for "www.example.com" using specific DNS server: $ dig www.example.com cname @9.9.9.9 Check CNAME record for "www.example.com" using specific DNS server via DOT: $ dig www.example.com cname @9.9.9.9 +tls Check CNAME record for "www.example.com" using specific DNS server via DOH: $ dig www.example.com cname @dns.quad9.net +https Perform a reverse DNS lookup for the IP address "9.9.9.9": $ dig -x 9.9.9.9 Query authoritative DNS: $ dig +nssearch example.com Check DNSSEC: $ dig +dnssec example.com Display the full trace of the DNS query for MX record: $ dig +trace example.com mx @9.9.9.9