4.4BSD/usr/src/contrib/bind-4.9/contrib/umich/query.1

.TH QUERY 1 "10 March 1990"
.UC 6
.SH NAME
query \- query nameservers through resolver library calls
.SH SYNOPSIS
.B query
[-n
.I nameserver]
[-t
.I type]
[-c
.I class]
[-r 
.I retry] 
[-p 
.I retry period] 
[-d] [-s] [-v] host
.SH DESCRIPTION
The
.IR query
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
.IR host
and
.IR ns
are treated without case-sensitivity.
.SH OPTIONS
.TP 1i
.B \-n
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)
.TP 1i
.B \-t
The type of resource record of interest.  Types include:
.RS 1.5i
.TP 1i
A
address
.PD 0
.TP 1i
NS
nameserver
.TP 1i
CNAME
canonical name
.TP 1i
PTR	
domain name pointer
.TP 1i
SOA	
start of authority
.TP 1i
WKS	
well-known service
.TP 1i
HINFO
host information
.TP 1i
MINFO
mailbox information
.TP 1i
MX	
mail exchange
.TP 1i
RP	
responsible person
.TP 1i
MG	
mail group member
.TP 1i
ANY	
wildcard
.RE
.PD
.IP
Note that any case may be used.  (default:  ANY)
.TP 1i
.B \-c
The class of resource records of interest.
Classes include:
.RS 2i
.TP 1i
IN	
Internet
.PD 0
.TP 1i
HS	
Hesiod
.TP 1i
CHAOS
Chaos
.TP 1i
ANY	
wildcard
.RE
.PD
.IP
Note that any case may be used.  (default:  IN)
.TP 1i
.B \-r
The number of times to retry if the nameserver is
not responding.  (default:  4)
.TP 1i
.B \-p
Period to wait before timing out.  (default:  RES_TIMEOUT)
.IR options
field.  (default:  any answer)
.TP 1i
.B \-d
Turn on debugging.  This sets the RES_DEBUG bit of the resolver's
.IR options
field.  (default:  no debugging)
.TP 1i
.B \-s
Use a
.IR 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
.IR options
field.  (default:  UDP)
.TP 1i
.B \-v
Synonym for the 's' flag.
.TP 1i
.B host
The name of the host (or domain) of interest.
.SH FILES
/etc/resolv.conf 	to get the default ns and search lists
.br
<arpa/nameser.h> 	list of usable RR types and classes
.br
<resolv.h>		list of resolver flags
.SH "SEE ALSO"
nslookup(1), nstest(1), nsquery(1), named(8), resolver(5)
.SH DIAGNOSTICS
If the resolver fails to answer the query and debugging has not been
turned on,
.IR query
will simply print a message like:
.TP 1i
Query failed (rc = 1) : Unknown host
.LP
The value of the return code is supplied by h_errno.
.SH BUGS
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.
.PP
Query 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)
addresses (e.g. 1.2.3.4.5).
.SH AUTHOR
Bryan Beecher