dig is command line DNS Lookup program pre-installed on *nix and Macs. If you don’t have access to dig from the command line, there are some websites that offer a web interface to dig (e.g. Google Toolbox’s Online Dig).
Basic Lookup (Similar to ping)
Advantages over ping:
- Doesn’t get grumpy when you include http:// at the beginning
- Includes CNAME information if the lookup involves a CNAME record
Lookup Nameserver for a Specific URL
dig NS example.com
This generally returns something like
;; ANSWER SECTION: example.com. 86400 IN NS a.iana-servers.net. example.com. 86400 IN NS b.iana-servers.net.
Basic Lookup Using a Specific Nameserver
dig example.com @a.iana-servers.net
Where a.iana-servers.net is one of the nameservers returned when you queried with
This is particularly useful when you want to confirm a new nameserver is properly configured before changing nameserver settings.
Lookup IPv6 Record
You can lookup a IPv6 record by requesting a
dig AAAA example.com
If a record exists, you’ll get a value like
2607:f8b0:4004:801::200e. For many domains, no
AAAA record is set, in which case you will not get any value.
dig MX example.com
Reverse DNS (lookup by IP)
dig -x 127.0.0.1