dig flags & options

+short

Show only the answer in a concise format.

dig +short example.com

+trace

Trace the full DNS delegation path from root servers.

dig +trace example.com

-t

Specify the DNS record type to query.

dig -t MX example.com
dig -t AAAA example.com

@server

Query a specific DNS server.

dig @8.8.8.8 example.com
dig @1.1.1.1 example.com A

+noall +answer

Suppress all output sections except the answer.

dig +noall +answer example.com

-x

Perform a reverse DNS lookup on an IP address.

dig -x 8.8.8.8
dig -x 2001:4860:4860::8888

+nocmd

Omit the initial command line from the output.

dig +nocmd +noall +answer example.com ANY

+norecurse

Send a non-recursive query.

dig +norecurse example.com @ns1.example.com