Testing DNS with DIG
"Dig" is the recommended tool for testing and troubleshooting DNS systems. Dig is maintained by Internet Systems Consortium, Inc., who also maintain the Berkley Internet Name Domain (BIND) software. It is open source software and is available for many architectures and operating systems.
If you are a Linux user, depending on which distribution you run, dig is usually either installed with BIND or provided as supplemental package.
See the Internet Systems Consortium’s official Web site for further details: http://www.isc.org/downloads/bind
An example usage for Dig:
$ dig –t any +norec www.example.com @192.0.2.1
In the above example:
•"-t any": requests any type of record (A, NS, CNAME, PTR, and so on).
•"+norec": indicates that the request should be sent with the recursive flag set to "off".
•"www.example.com": the record you are testing.
•"@192.0.2.1": the name server that the request is sent to.
When testing a DNS server or service, it is very important that you always perform non-recursive queries. This ensures that you receive either an authoritative answer or that you know exactly which name servers are authoritative for the domain name you are trying to resolve. You do not receive an answer that the name server you are querying has looked up for you (since you cannot always verify the source of that information).