Inspect bind named records using dig

dig can be used in various ways, here are a few common usage scenarios:

Basic query of A records, using default nameserver:

dig testdomain.com.

Check MX records:

dig testdomain.com. MX

Check MX records using a particular nameserver:

dig @ns1.foobar.net. testdomain.com. MX

Do reverse lookup:

dig -x 111.222.112.191

The default query class for dig is IN and you rarely need to change this. You can query any type of record (CNAME or TXT for example) in the same way that MX are queried in the example above.

You can do tests using a TSIG signature when testing master/slave configurations: Use -k to specify the key filename or -y to pass the key on the command line (though this is a security risk on a multi-user system) - using -k is probably easier anyway.