The Tools of the Trade

Knowledge of the appropriate tools can go a long way in debugging DNS problems or finding out information you need about certain domains. The BIND package comes with many useful programs, and is worth downloading if your system does not have these programs installed. I'll mention a few here.

DIG - Domain Internet Groper

Dig is perhaps the best tool for analyzing the DNS. The man page covers the options, but here are a few examples. To find the IP address of the machine "hobbes.gtlug.org", one might use:
$ dig hobbes.gtlug.org
which returns a lot of verbose information, among which is:
hobbes.gtlug.org.        56846   A       130.18.92.25
so the IP address is determined to be "130.18.92.25". To get all the information contained in the DNS about "hobbes.gtlug.org", one might use:
$ dig any hobbes.gtlug.org
...
hobbes.gtlug.org.       85967   TXT     "1 Research Boulevard"
hobbes.gtlug.org.       85967   TXT     "Starkville, MS"
hobbes.gtlug.org.       85967   TXT     "(601) 324-xxxx"
hobbes.gtlug.org.       85967   TXT     "David L. Simmons"
hobbes.gtlug.org.       52639   A       130.18.92.25
...
To find out which machine serves as a nameserver for the domain "gtlug.org", one could use:
$ dig ns gtlug.org
...
gtlug.org.      77634   NS      calvin.gtlug.org.
gtlug.org.      77634   NS      DUNE.EE.MSSTATE.EDU.
...
Knowing that the machine "calvin.gtlug.org" is a nameserver for the "gtlug.org" domain, we can ask it directly for information about the host "hobbes.gtlug.org" and perhaps get more information:
$ dig @calvin.gtlug.org any hobbes.gtlug.org
...
hobbes.gtlug.org.       86400   A       130.18.92.25
hobbes.gtlug.org.       86400   MX      10 hobbes.gtlug.org.
hobbes.gtlug.org.       86400   MX      20 Dune.EE.MsState.Edu.
hobbes.gtlug.org.       86400   HINFO   i486/66 Linux
hobbes.gtlug.org.       86400   TXT     "David L. Simmons"
hobbes.gtlug.org.       86400   TXT     "1 Research Boulevard"
hobbes.gtlug.org.       86400   TXT     "Starkville, MS"
hobbes.gtlug.org.       86400   TXT     "(601) 324-xxxx"
...
We might, if we are nosy, ask for a zone transfer of the "gtlug.org" domain:
dig @calvin.gtlug.org axfr gtlug.org
...
[pages of zone information displayed]
...
NOTE: Zone transfers are potentially expensive on bandwidth and cpu, and it is probably not very friendly to be performing zone transfers on nameservers that aren't yours. Some nameservers disable public zone transfers altogether.

HOST

The "host" program performs most of the simple DNS queries that "dig" does, but is much simpler and does not give as much verbose statistical information. It is preferable to use if you just need to query an IP address quickly, for example.

To query "hobbes.gtlug.org":

$ host hobbes.gtlug.org
hobbes.gtlug.org has address 130.18.92.25
hobbes.gtlug.org mail is handled by Dune.EE.MsState.Edu
hobbes.gtlug.org mail is handled by hobbes.gtlug.org
To query all information on "hobbes.gtlug.org":
$ host -t any hobbes.gtlug.org
hobbes.gtlug.org descriptive text "1 Research Boulevard"
hobbes.gtlug.org descriptive text "Starkville, MS"
hobbes.gtlug.org descriptive text "(601) 324-xxxx"
hobbes.gtlug.org descriptive text "David L. Simmons"
hobbes.gtlug.org has address 130.18.92.25
hobbes.gtlug.org mail is handled by Dune.EE.MsState.Edu
hobbes.gtlug.org mail is handled by hobbes.gtlug.org
To find out the nameserver for the "gtlug.org" domain:
host -t ns gtlug.org
gtlug.org NS calvin.gtlug.org
gtlug.org NS DUNE.EE.MSSTATE.EDU

NSLOOKUP

The "nslookup" program is the classic DNS tool, and is probably available on more systems than "dig" or "host". Functionality is similar, and the man page goes over the semantics.


Last modified: April 10, 2003 02:58:41 UTC
David Simmons
send mail