/etc/resolv.conf
to get the default ns and search lists
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.)
-t type
The type of resource record of interest. Types include:
address
nameserver
canonical name
domain name pointer
start of authority
well-known service
host information
mailbox information
mail exchange
responsible person
mail group member
DCE or AFS server
wildcard
Note that any case may be used. (Default: ANY.)
-c class
The class of resource records of interest. Classes include:
Internet
Hesiod
Chaos
wildcard
Note that any case may be used. (Default: IN.)
-r retry
The number of times to retry if the nameserver is not responding. (Default: 4.)
-p period
Period to wait before timing out. (Default: RES_TIMEOUT.)
-d
Turn on debugging. This sets the RES_DEBUG bit of the resolver's options field. (Default: no debugging.)
-s
Use a stream rather than a packet. This uses a TCP stream connection with the nameserver rather than a UDP datagram. This sets the RES_USEVC bit of the resolver's options field. (Default: UDP datagram.)
-v
Synonym for the “-s” flag.
The name of the host (or domain) of interest.
/etc/resolv.conf
to get the default ns and search lists
<arpa/nameser.h>
list of usable RR types and classes
<resolv.h>
list of resolver flags
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.