← ../

linux dig command

The dig command is a very useful tool to perform/test dns resolution on the client side. It performs similar functions to the more ancient nslookup command.


to get the ip(s) in the A record of a fully qualified domain name with the details of the answer (TTL, DNS server ip etc)

dig 200013.net A

if you are not interested in the details, you can use "+short" to get only the ip(s) in the A record

dig +short 200013.net A

to bypass your local resolver, and see the recursive query starting at the root dns servers, use "+trace" to see the whole chain of resolution

dig +trace 200013.net A

to use a specific resolver

dig @8.8.8.8 200013.net A

to get the ipv6 address of a fully qualified domain name

dig 200013.net AAAA

to get the authoritative name servers for a given domain

dig 200013.net NS

to get the mail exchangers(MX) servers for a given domain

dig 200013.net MX

to get the reverse dns record for a given ip

dig -x 45.32.146.108

to get a txt record for a given domain

dig 200013.net TXT