Using dig

Last edit

Added:

> To do a reverse lookup:
> $ dig -x 192.168.0.1


To do a lookup using a specific DNS server, use:

  $ dig @1.2.3.4 example.com

This will request the most important records of domain example.com from DNS server 1.2.3.4

To do a reverse lookup:

  $ dig -x 192.168.0.1

To check whether (for example) a domain is carrying SPF records:

 $ dig -t txt vankuik.nl
 ...
 ...
 vankuik.nl.		86400	IN	TXT	"v=spf1  
 a:charlie.dutchvirtual.nl a:delta.dutchvirtual.nl a:smtp.dutchvirtual.nl 
 a:smtp.casema.nl include:aspmx.googlemail.com ~all"
 ...
 ...

To see which nameserver is authoritative for a domain:

  $ dig example.com. ns
  $ dig @nameserver.com. example.com. ns
  $ host -t ns example.com.