There are a number of tools that are available to assist with testing and troubleshooting problems with your BIND configuration. The simplest tool on most systems is the host command, which simply perform an address lookup or a reverse address lookup. More complete information can be gather using dig. On extremely old systems, nslookup might still be the only available option for this type of testing, but it is rather confusing and inconsistent in a number of ways and is not recommended.
The host utility provides a very easy to use command line interface for looking up a name or an address. In its simplest usage form it will return the IP address or addresses when given a hostname as its argument. The mail host address or addresses will also be returned if available. If the command line argument is an IP address, a reverse lookup will be performed and the hostname will be returned. host also has a few additional options that may be helpful in tracing DNS problems or testing your configuration for correctness.
![]() | Not all options of the host utility are discussed here. For more detailed coverage of all of the command line options consult the host manpage, either via the Webmin manpages interface or from the command line. |
The -v option enables verbose output, which is in a format compatible with BINDs own master file format, so it can be directly imported into a BIND configuration without addition parsing or modification. The -t option allows you to specify the query type to make of the nameserver. There are many query types, but common types that may be useful include cname which lists the canonical name entries for the host if available, and the ns type which lists the authoritative nameservers for the host.
One of the more verbose options is the -a option which provides the same results as -v -t any, will list all available fields for the host, including all A records, CNAME records, NS records, etc. Using this tool against your own nameserver is a good way to insure it is providing the information you expect.
The dig, or domain information groper, provides the ability to query any domain server for information about the domains it serves. It operates in both an interactive mode and a batch query mode. Using dig is much like using host, in that you may enter just the command and the name to lookup. However, dig is more verbose by default and presents a much wider array or information, though in a somewhat less readable form.