Dig command examples
Posted on May 21, 2021
Resolve with minimal info:
$ dig google.com +short
Resolve and show only answers:
$ dig google.com +noall +answer
Resolve with a specific dns server:
$ dig google.com @8.8.8.8
Resolve with a specific record type:
$ dig google.com MX
Resolve all records for a domain:
$ dig google.com ANY
Trace DNS route for a domain:
$ dig google.com +trace
Reverse DNS Lookup:
$ dig -x 142.250.179.206 +noall +answer
Default dig settings
To show always short answers from dig, run the following command:
$ vim ~/.digrc
And add the following content:
+noall
+answer