dig/nslookup

dig

Basic command:

$ dig @<nameserver> <DOMAIN> [query_type]

# eg.
$ dig @8.8.8.8 google.com A #(a) - equivalent to nslookup
$ dig @8.8.8.8 google.com AAAA #(b) - equivalent to nslookup
$ dig @8.8.8.8 google.com NS #(c) - equivalent to nslookup
$ dig @8.8.8.8 google.com MX #(d) - equivalent to nslookup

Other useful options:

$ dig ... +[no]<options>

# eg. 
$ dig ... +short

nslookup

Basic command:

$ nslookup -type=<query_type> <DOMAIN> [nameserver]

# eg. 
$ nslookup -type=A google.com 8.8.8.8 #(a)
$ nslookup -type=AAAA google.com 8.8.8.8 #(b)
$ nslookup -type=NS google.com 8.8.8.8 #(c)
$ nslookup -type=MX google.com 8.8.8.8 #(d)

Last updated