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:


Check MX records:

dig MX

Check MX records using a particular nameserver:

dig MX

Do reverse lookup:

dig -x

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.