- Lookup A record (default):
dig <domain> - Lookup specific record types
dig <domain> [options]Options are the query types :
- AAAA
- MX
- NS
- TXT
- SOA
- SRV
- CNAME
- ANY
- Query a specific DNS Server
dig @[Server IP] [domain] [query]Example : dig @8.8.8.8 example.com A , dig @8.8.8.8 example.com mx
- Useful flags/Output controls
- +short //print only concise answers (IPs, records).
- +noall +answer //suppress everything except answer section.
- +nocmd //hide the command and header.
- +ttlunits // show TTL with time units.
- +multiline //long records nicely.
- +noquestion / +noauthority / +noadditional //hide sections.
- +comments / +cmd //show query comments and command line used.
Example: dig +noall +answer example.com MX- Zone Transfer
dig AXFR @[Nameserver] [Domain] Example : dig @ns1.example.com example.com AXFR