dnsquery(ADMN)


dnsquery -- query domain name servers using resolver

Syntax

dnsquery [-n nameserver] [-t type] [-c class] [-r retry]
[-p period] [-d] [-s] [-v] host

Description

The dnsquery program is a general interface to name servers via BIND resolver library calls. The program supports queries to the name server with an opcode of QUERY. This program is intended to replace or supplement programs like nslookup(TC).

Options

All arguments except for host and nameserver are treated without case-sensitivity.

-n nameserver
The name server to be used in the query. Name servers can appear as either Internet addresses of the form:

w.x.y.z

or as domain names. The default is specified in /etc/resolv.conf.


-t type
The type of resource record of interest. Types include:

A
address

NS
name server

CNAME
canonical name

PTR
domain name pointer

SOA
start of authority

WKS
well-known service

HINFO
host information

MINFO
mailbox information

MX
mail exchange

RP
responsible person

MG
mail group member

AFSDB
DCE or AFS server

ANY
wildcard

Note that any case may be used. The default type is ANY.


-c class
The class of resource records of interest. Classes include:

IN
Internet

HS
Hesiod

CHAOS
Chaos

ANY
wildcard

Note that any case may be used. The default class is IN.


-r retry
The number of times to retry if the name server is not responding. The default is 4.

-p period
The period to wait before timing out. The default is RES_TIMEOUT.

-d
Turn on debugging. This sets the RES_DEBUG bit of the resolver's options field. The default is no debugging.

-s
Use a stream rather than a packet. This uses a TCP stream connection with the name server, rather than a UDP datagram. This sets the RES_USEVC bit of the resolver's options field. The default is to use UDP datagrams.

-v
Synonym for -s.

host
The name of the host (or domain) of interest.

Usage

Queries of a class other than IN can have interesting results since ordinarily a name server only has a list of root name servers for class IN resource records.

dnsquery uses a call to inet_addr(SLIB-osr5) 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 (for example, 1.2.3.4.5).

Files


/etc/resolv.conf
to get the default name server and search lists

arpa/nameser.h
list of usable RR types and classes

resolv.h
list of resolver flags

Diagnostics

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.

See also

named(ADMN), nslookup(TC), resolver(SLIB-osr5)

Notices

Author

Bryan Beecher

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.

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).


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005