The basic dig pattern is: choose a name, choose a DNS record type, and optionally choose a DNS server. That makes dig predictable and easy to use in troubleshooting.
dig name type
dig example.com A
dig example.com MX
dig example.com TXTBasic syntax
| Part | Meaning | Example |
|---|---|---|
| name | The domain, subdomain, or reverse DNS name you want to query. | example.com |
| type | The DNS record type. | A, AAAA, MX, TXT, CNAME, NS, SOA |
| server | Optional resolver to ask directly. | @1.1.1.1 or @8.8.8.8 |
Ask a specific resolver
If users in different networks see different answers, ask more than one resolver. This helps separate a DNS provider problem from a cache problem.
dig @1.1.1.1 example.com A
dig @8.8.8.8 example.com A
dig @9.9.9.9 example.com AGet a short answer
For quick checks, +short removes most of the detail and prints only the returned data.
dig example.com A +shortWhen to use full output
Use full output when the status matters. The header can show NOERROR, NXDOMAIN, SERVFAIL, recursion flags, and timing information. Those details are useful when the answer section is empty.