<- Back


DNS lookup
Get IP for domain name
dig google.com
Get domain name for IP (reverse lookup)
dig -x
Shorten output
dig -x +short
Get A records
dig +noall +answer -t A google.com
Get AAAA records
dig +noall +answer -t AAAA google.com
Get MX (e-mail, smtp) records
dig google.com MX
Specify DNS server
dig @ google.com
dig +trace google.com
DNSSEC (flags must include ad and response RRSIG)
dig cyberciti.biz +dnssec +multi
DNS over TLS (DoT)
dig +tls google.com
DNS over TLS (DoT) via dog
dog google.com --tls @dns.google

dig ns nslookup

dig uses the OS resolver libraries. nslookup uses is own internal ones. That is why Internet Systems Consortium (ISC) has been trying to get people to stop using nslookup for some time now. It causes confusion.


dig vs dog

I recommend using dog, a command-line DNS client written in Rust.