aboutsummaryrefslogtreecommitdiffstats
path: root/man3/resolver.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/resolver.3')
-rw-r--r--man3/resolver.382
1 files changed, 62 insertions, 20 deletions
diff --git a/man3/resolver.3 b/man3/resolver.3
index 01306e6b43..57ac009cd3 100644
--- a/man3/resolver.3
+++ b/man3/resolver.3
@@ -85,44 +85,65 @@ Link with \-lresolv.
These functions make queries to and interpret the responses from Internet
domain name servers.
.PP
-The \fBres_init\fP() function reads the configuration files (see
+The
+.BR res_init ()
+function reads the configuration files (see
resolv.conf(5)) to get the default domain name, search order and name
server address(es).
If no server is given, the local host is tried.
If no domain is given, that associated with the local host is used.
It can be overridden with the environment variable LOCALDOMAIN.
-\fBres_init\fP() is normally executed by the first call to one of the
+.BR res_init ()
+is normally executed by the first call to one of the
other functions.
.PP
-The \fBres_query\fP() function queries the name server for the
+The
+.BR res_query ()
+function queries the name server for the
fully-qualified domain name \fIname\fP of specified \fItype\fP and
\fIclass\fP.
The reply is left in the buffer \fIanswer\fP of length
\fIanslen\fP supplied by the caller.
.PP
-The \fBres_search\fP() function makes a query and waits for the response
-like \fBres_query\fP(), but in addition implements the default and search
+The
+.BR res_search ()
+function makes a query and waits for the response
+like
+.BR res_query (),
+but in addition implements the default and search
rules controlled by RES_DEFNAMES and RES_DNSRCH (see description of
\fI_res\fP options below).
.PP
-The \fBres_querydomain\fP() function makes a query using \fBres_query\fP()
+The
+.BR res_querydomain ()
+function makes a query using
+.BR res_query ()
on the concatenation of \fIname\fP and \fIdomain\fP.
.PP
-The following functions are lower-level routines used by \fBres_query\fP().
+The following functions are lower-level routines used by
+.BR res_query ().
.PP
-The \fBres_mkquery\fP() function constructs a query message in \fIbuf\fP
+The
+.BR res_mkquery ()
+function constructs a query message in \fIbuf\fP
of length \fIbuflen\fP for the domain name \fIdname\fP.
The query type
\fIop\fP is usually QUERY, but can be any of the types defined in
\fI<arpa/nameser.h>\fP. \fInewrr\fP is currently unused.
.PP
-The \fBres_send\fP() function sends a pre-formatted query given in
+The
+.BR res_send ()
+function sends a pre-formatted query given in
\fImsg\fP of length \fImsglen\fP and returns the answer in \fIanswer\fP
which is of length \fIanslen\fP.
-It will call \fBres_init\fP(), if it
+It will call
+.BR res_init (),
+if it
has not already been called.
.PP
-The \fBdn_comp\fP() function compresses the domain name \fIexp_dn\fP
+The
+.BR dn_comp ()
+function compresses the domain name \fIexp_dn\fP
and stores it in the buffer \fIcomp_dn\fP of length \fIlength\fP.
The compression uses an array of pointers \fIdnptrs\fP to previously
compressed names in the current message.
@@ -149,13 +170,17 @@ This field can contain the bitwise ``or''
of the following options:
.TP
.B RES_INIT
-True if \fBres_init\fP() has been called.
+True if
+.BR res_init ()
+has been called.
.TP
.B RES_DEBUG
Print debugging messages.
.TP
.B RES_AAONLY
-Accept authoritative answers only. \fBres_send\fP() continues until
+Accept authoritative answers only.
+.BR res_send ()
+continues until
it fins an authoritative answer or returns an error. [Not currently
implemented].
.TP
@@ -173,11 +198,14 @@ implemented].
.B RES_RECURSE
Set the recursion desired bit in queries.
Recursion is carried out
-by the domain name server, not by \fBres_send\fP().
+by the domain name server, not by
+.BR res_send ().
[Enabled by default].
.TP
.B RES_DEFNAMES
-If set, \fBres_search\fP() will append the default domain name to
+If set,
+.BR res_search ()
+will append the default domain name to
single component names, ie. those that do not contain a dot.
[Enabled by default].
.TP
@@ -185,20 +213,34 @@ single component names, ie. those that do not contain a dot.
Used with RES_USEVC to keep the TCP connection open between queries.
.TP
.B RES_DNSRCH
-If set, \fBres_search\fP() will search for host names in the current
+If set,
+.BR res_search ()
+will search for host names in the current
domain and in parent domains.
This option is used by
.BR gethostbyname (3).
[Enabled by default].
.SH "RETURN VALUE"
-The \fBres_init\fP() function returns 0 on success, or \-1 if an error
+The
+.BR res_init ()
+function returns 0 on success, or \-1 if an error
occurs.
.PP
-The \fBres_query\fP(), \fBres_search\fP(), \fBres_querydomain\fP(),
-\fBres_mkquery\fP() and \fBres_send\fP() functions return the length
+The
+.BR res_query (),
+.BR res_search (),
+.BR res_querydomain (),
+.BR res_mkquery ()
+and
+.BR res_send ()
+functions return the length
of the response, or \-1 if an error occurs.
.PP
-The \fBdn_comp\fP() and \fBdn_expand\fP() functions return the length
+The
+.BR dn_comp ()
+and
+.BR dn_expand ()
+functions return the length
of the compressed name, or \-1 if an error occurs.
.SH FILES
.nf