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 TXT

Basic syntax

PartMeaningExample
nameThe domain, subdomain, or reverse DNS name you want to query.example.com
typeThe DNS record type.A, AAAA, MX, TXT, CNAME, NS, SOA
serverOptional 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 A

Get a short answer

For quick checks, +short removes most of the detail and prints only the returned data.

dig example.com A +short

When 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.