Testing DNS Using dig

Use BIND'S Domain Information Groper (dig) command line tool to test against the delegation where the domain is hosted. Immediately see whether changes took place without accounting for the cache or TTL (Time to Live) that you have configured.

Note

Windows users can download the tool from BIND's website. Use Terminal to access dig on Linux and Macintosh systems.

Using dig

Before using BIND's dig tool, you must access or install dig on the system you use. After you have access to dig, you can use dig to test DNS.

dig Commands

Command Description Example
dig [hostname] Returns any A records found within the queried hostname's zone. dig oracle.com
dig [hostname] [record type] Returns the records of that type found within the queried hostname's zone. dig oracle.com MX
dig [hostname] +short Provides a brief answer, often an IP address. dig oracle.com +short
dig @[nameserver address] [hostname] Queries the nameserver directly instead of the resolver configured in a local system. dig @dnsmaster6.oracle.com
dig [hostname] +trace Adding +trace instructs dig to resolve the query from the root nameserver downwards and to report the results from each query step. dig oracle.com +trace
dig -x [IP address] Reverse lookup for IP addresses. dig -x 108.59.161.1