D. J. Bernstein
Internet publication
DNScache

DNS lookup tools

High-level tools

     dnsip fqdn
dnsip prints the IP addresses of fqdn on a single line. If fqdn does not exist, dnsip prints a blank line. You can list several fqdns; dnsip prints each result on a separate line.

Normally dnsip exits 0. If dnsip encounters a temporary problem that prevents it from determining the list of IP addresses, it prints an error message and exits 111. The same comments apply to the other programs described here.

     dnsipq udn
dnsipq feeds the name udn through qualification. It prints the fully qualified domain name and IP addresses on a single line. If the fully qualified domain name does not exist, dnsipq prints no addresses. You can list several udns; dnsipq prints each result on a separate line.

     dnsname a.b.c.d
dnsname does a reverse lookup for the IP address a.b.c.d. It prints the first domain name for that address. If no domain names are listed in DNS, dnsname prints a blank line. You can list several IP addresses; dnsname prints each result on a separate line.

There is also a dnsfilter program that reads IP addresses from its input and performs many reverse lookups in parallel.

     dnsmx fqdn
dnsmx prints the MX records of fqdn. If there are no MX records, dnsmx prints an artificial MX record, simulating the behavior of MTAs.

     dnstxt fqdn
dnstxt prints the TXT record of fqdn on a single line. If there is no TXT record, dnstxt prints a blank line.

Debugging tools

The interfaces for these tools are subject to change.

     dnsq t fqdn s
dnsq sends a non-recursive DNS query to DNS server s for records of type t under the domain name fqdn. It prints the results in a human-readable format.

t may be a name or number. The most common choice is any (or 255) for all records.

dnsq serves the same purpose as dig +norec but has a more compact output format.

     dnstrace t fqdn r
dnstrace searches for all DNS servers that can affect the resolution of records of type t under the domain name fqdn, starting from the root server r. You can list more than one root server.

dnstrace uses the standard DNS resolution algorithm, but follows all possible paths in the algorithm. It prints all responses it receives from DNS servers; it also prints warnings about slow servers, dead servers, lame servers, and misformatted packets. The output uses ul codes for boldface and underline.

dnstrace is similar in spirit to DOC and dnswalk but is much more effective than those tools at debugging resolution problems.

Beware that, as of February 2000, dnstrace produces half a megabyte of output for the complete trace of a typical .com name starting from all the root servers. There are more than 200 computers around the world that can affect all .com names.