resolver.3n (2010 09)
r
resolver(3N) resolver(3N)
);
int get_resfield(
int field,
void *value,
sizeof value
);
OBSOLESCENT INTERFACE
void herror(const char *s);
DESCRIPTION
These routines are used for making, sending, and interpreting query and reply messages with Internet
domain name servers.
Global configuration and state information used by the resolver routines are kept in the structure
_res
and are defined in <resolv.h>. Most of the fields have reasonable defaults and can be ignored. The
resolver options are stored in the _res.options field and are listed below. The options are stored as a
simple bit mask containing the bitwise OR of the options enabled.
In a multithreaded environment, a thread specific
_res structure is allocated for each thread.
RES_INIT True if the initial name server address and default domain name are initial-
ized (i.e., res_init() has been called).
RES_DEBUG Print debugging messages.
RES_AAONLY Accept authoritative answers only. With this option,
res_send() should
continue until it finds an authoritative answer or finds an error. Currently
this is not implemented.
RES_PRIMARY Query the primary server only. Currently this is not implemented.
RES_USEVC Use TCP connections for queries instead of UDP datagrams.
RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between queries.
This is useful only in programs that regularly do many queries. UDP should
be the normal mode used.
RES_IGNTC The name server will set the truncation bit if all of the data does not fit into
the response datagram packet. If RES_IGNTC is set, res_send() will not
retry the query with TCP (i.e., ignore truncation errors).
RES_RECURSE Set the recursion-desired bit in queries. This is the default. (
res_send()
does not do iterative queries and expects the name server to handle recursion.)
RES_DEFNAMES If set, res_search() appends the default domain name to single-
component names (those that do not contain a dot). This option is enabled by
default.
RES_DNSRCH If this option is set, res_search() searches for host names in the current
domain and in parent domains; see hostname (5). This is used by the standard
host lookup routine gethostbyname() (see gethostent (3N)). This option is
enabled by default.
Initialization of the resolver structure normally occurs on the first call to one of the resolver routines
below. If there are errors in the configuration file, they are silently ignored.
The values for retransmission timeout and number of retries to be attempted can be configured. These
correspond to the retrans and retry fields in the
_res structure. The following three options, listed in the
order of precedence, have been provided for configuring the retransmission timeout and retry values.
1. Environment Variables,
2. Configuration file
/etc/resolv.conf,
3. Through calls to API
set_resfield().
retrans and retry can be configured through the Environmental Variables
RES_RETRANS and
RES_RETRY as follows:
RES_RETRANS=values in milliseconds
RES_RETRY=number of retries
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010