dig (Domain Information Groper) is a command-line utility, part of the BIND tools, for querying DNS servers. It prints the raw response in detail, which makes it the standard tool for debugging DNS problems on Linux and macOS.
Why it matters
Graphical checkers hide details that matter: the response flags, the remaining TTL, which section a record appears in and which server answered. With dig you choose the exact server, the record type and whether recursion is requested, so you can compare your resolver against the authoritative servers and see where answers differ.
Example
dig example.com A # default resolver
dig +short example.com MX # compact output
dig @8.8.8.8 example.com TXT # ask a specific server
dig +norecurse @ns1.example.net example.com # authoritative only
dig +trace example.com # follow delegation from the root
dig -x 203.0.113.10 # reverse lookup
+trace shows each referral from the root to the final answer, which is the fastest way to find a broken delegation.
Common mistakes
- Testing only with the system resolver and missing a stale cache.
- Reading the ANSWER section but ignoring the status and flags in the header.
- Forgetting that
+shorthides the TTL. - Using the wrong record type, then calling the result empty.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.