dnsquery - query domain name servers using resolver
dnsquery [-n nameserver] [-t type] [-c class] [-r retry] [-p period] [-d] [-s] [-v] host
The dnsquery program is a general interface to nameservers via BIND resolver library calls. The program supports queries to the nameserver with an opcode of QUERY. This program is intended to be a replacement or supplement to programs like nstest, nsquery and nslookup. All arguments except for host and nameserver are treated without case-sensitivity.
-n nameserver
The nameserver to be used in the query. Nameservers can appear
as either Internet addresses of the form w.x.y.z or can
appear as domain names. (Default: as specified in
/etc/resolv.conf.)
Note that any case may be used. (Default: ANY.)
Note that any case may be used. (Default: IN.)
If the resolver fails to answer the query and debugging has not been turned on, dnsquery will simply print a message like: Query failed (rc = 1): Unknown host
The value of the return code is supplied by h_errno .
nslookup(8) , nstest(1) , nsquery(1) , named(8) , resolver(5) .
Bryan Beecher
Queries of a class other than IN can have interesting results since ordinarily a nameserver only has a list of root nameservers for class IN resource records.
Dnsquery uses a call to inet_addr() to determine if the argument for the ``-n'' option is a valid Internet address. Unfortunately, inet_addr() seems to cause a segmentation fault with some (bad) IP addresses (e.g., 1.2.3.4.5).