xref: /netbsd-src/external/bsd/libbind/dist/doc/resolver.man5 (revision 5bbd2a12505d72a8177929a37b5cee489d0a1cfd)
1*b5677b36Schristos.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
2*b5677b36Schristos.\"
3*b5677b36Schristos.\" Permission to use, copy, modify, and distribute this software for any
4*b5677b36Schristos.\" purpose with or without fee is hereby granted, provided that the above
5*b5677b36Schristos.\" copyright notice and this permission notice appear in all copies.
6*b5677b36Schristos.\"
7*b5677b36Schristos.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
8*b5677b36Schristos.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9*b5677b36Schristos.\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
10*b5677b36Schristos.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11*b5677b36Schristos.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12*b5677b36Schristos.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
13*b5677b36Schristos.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14*b5677b36Schristos.\"
15*b5677b36Schristos.\" Copyright (c) 1986 The Regents of the University of California.
16*b5677b36Schristos.\" All rights reserved.
17*b5677b36Schristos.\"
18*b5677b36Schristos.\" Redistribution and use in source and binary forms are permitted
19*b5677b36Schristos.\" provided that the above copyright notice and this paragraph are
20*b5677b36Schristos.\" duplicated in all such forms and that any documentation,
21*b5677b36Schristos.\" advertising materials, and other materials related to such
22*b5677b36Schristos.\" distribution and use acknowledge that the software was developed
23*b5677b36Schristos.\" by the University of California, Berkeley.  The name of the
24*b5677b36Schristos.\" University may not be used to endorse or promote products derived
25*b5677b36Schristos.\" from this software without specific prior written permission.
26*b5677b36Schristos.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
27*b5677b36Schristos.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
28*b5677b36Schristos.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29*b5677b36Schristos.\"
30*b5677b36Schristos.\"	@(#)resolver.5	5.9 (Berkeley) 12/14/89
31*b5677b36Schristos.\"	Id: resolver.man5,v 1.2 2009/01/21 00:12:34 each Exp
32*b5677b36Schristos.\"
33*b5677b36Schristos.Dd November 11, 1993
34*b5677b36Schristos.Dt RESOLVER 5
35*b5677b36Schristos.Os BSD 4
36*b5677b36Schristos.Sh NAME
37*b5677b36Schristos.Nm resolver
38*b5677b36Schristos.Nd resolver configuration file
39*b5677b36Schristos.Sh SYNOPSIS
40*b5677b36Schristos.Pa /etc/resolv.conf
41*b5677b36Schristos.Sh DESCRIPTION
42*b5677b36SchristosThe
43*b5677b36Schristos.Nm resolver
44*b5677b36Schristosis a set of routines in the C library
45*b5677b36Schristos.Pq Xr resolve 3
46*b5677b36Schristosthat provide access to the Internet Domain Name System.
47*b5677b36SchristosThe
48*b5677b36Schristos.Nm resolver
49*b5677b36Schristosconfiguration file contains information that is read
50*b5677b36Schristosby the
51*b5677b36Schristos.Nm resolver
52*b5677b36Schristosroutines the first time they are invoked by a process.
53*b5677b36SchristosThe file is designed to be human readable and contains a list of
54*b5677b36Schristoskeywords with values that provide various types of
55*b5677b36Schristos.Nm resolver
56*b5677b36Schristosinformation.
57*b5677b36Schristos.Pp
58*b5677b36SchristosOn a normally configured system, this file should not be necessary.
59*b5677b36SchristosThe only name server to be queried will be on the local machine,
60*b5677b36Schristosthe domain name is determined from the host name,
61*b5677b36Schristosand the domain search path is constructed from the domain name.
62*b5677b36Schristos.Pp
63*b5677b36SchristosThe different configuration directives are:
64*b5677b36Schristos.Bl -tag -width "nameser"
65*b5677b36Schristos.It Li nameserver
66*b5677b36SchristosInternet address (in dot notation) of a name server that the
67*b5677b36Schristos.Nm resolver
68*b5677b36Schristosshould query.  Up to
69*b5677b36Schristos.Dv MAXNS
70*b5677b36Schristos(see
71*b5677b36Schristos.Pa <resolv.h> )
72*b5677b36Schristosname servers may be listed, one per keyword.
73*b5677b36SchristosIf there are multiple servers, the
74*b5677b36Schristos.Nm resolver
75*b5677b36Schristoslibrary queries them in the order listed.
76*b5677b36SchristosIf no
77*b5677b36Schristos.Li nameserver
78*b5677b36Schristosentries are present, the default is to use the name server on the local machine.
79*b5677b36Schristos(The algorithm used is to try a name server, and if the query times out,
80*b5677b36Schristostry the next, until out of name servers,
81*b5677b36Schristosthen repeat trying all the name servers
82*b5677b36Schristosuntil a maximum number of retries are made).
83*b5677b36Schristos.It Li domain
84*b5677b36SchristosLocal domain name.
85*b5677b36SchristosMost queries for names within this domain can use short names
86*b5677b36Schristosrelative to the local domain.
87*b5677b36SchristosIf no
88*b5677b36Schristos.Li domain
89*b5677b36Schristosentry is present, the domain is determined from the local host name returned by
90*b5677b36Schristos.Xr gethostname  ;
91*b5677b36Schristosthe domain part is taken to be everything after the first
92*b5677b36Schristos.Sq \&. .
93*b5677b36SchristosFinally, if the host name does not contain a domain part, the root
94*b5677b36Schristosdomain is assumed.
95*b5677b36Schristos.It Li search
96*b5677b36SchristosSearch list for host-name lookup.
97*b5677b36SchristosThe search list is normally determined from the local domain name;
98*b5677b36Schristosby default, it contains only the local domain name.
99*b5677b36SchristosThis may be changed by listing the desired domain search path
100*b5677b36Schristosfollowing the
101*b5677b36Schristos.Li search
102*b5677b36Schristoskeyword with spaces or tabs separating the names.
103*b5677b36SchristosMost
104*b5677b36Schristos.Nm resolver
105*b5677b36Schristosqueries will be attempted using each component
106*b5677b36Schristosof the search path in turn until a match is found.
107*b5677b36SchristosNote that this process may be slow and will generate a lot of network
108*b5677b36Schristostraffic if the servers for the listed domains are not local,
109*b5677b36Schristosand that queries will time out if no server is available
110*b5677b36Schristosfor one of the domains.
111*b5677b36Schristos.Pp
112*b5677b36SchristosThe search list is currently limited to six domains
113*b5677b36Schristoswith a total of 256 characters.
114*b5677b36Schristos.It Li sortlist
115*b5677b36SchristosAllows addresses returned by gethostbyname to be sorted.
116*b5677b36SchristosA
117*b5677b36Schristos.Li sortlist
118*b5677b36Schristosis specified by IP address netmask pairs. The netmask is
119*b5677b36Schristosoptional and defaults to the natural netmask of the net. The IP address
120*b5677b36Schristosand optional network pairs are separated by slashes. Up to 10 pairs may
121*b5677b36Schristosbe specified.  For example:
122*b5677b36Schristos.Bd -literal -offset indent
123*b5677b36Schristossortlist 130.155.160.0/255.255.240.0 130.155.0.0
124*b5677b36Schristos.Ed
125*b5677b36Schristos.It Li options
126*b5677b36SchristosAllows certain internal
127*b5677b36Schristos.Nm resolver
128*b5677b36Schristosvariables to be modified.
129*b5677b36SchristosThe syntax is
130*b5677b36Schristos.D1 Li options Ar option ...
131*b5677b36Schristoswhere
132*b5677b36Schristos.Ar option
133*b5677b36Schristosis one of the following:
134*b5677b36Schristos.Bl -tag -width "ndots:n "
135*b5677b36Schristos.It Li debug
136*b5677b36Schristossets
137*b5677b36Schristos.Dv RES_DEBUG
138*b5677b36Schristosin
139*b5677b36Schristos.Ft _res.options .
140*b5677b36Schristos.It Li ndots: Ns Ar n
141*b5677b36Schristossets a threshold for the number of dots which
142*b5677b36Schristosmust appear in a name given to
143*b5677b36Schristos.Fn res_query
144*b5677b36Schristos(see
145*b5677b36Schristos.Xr resolver 3 )
146*b5677b36Schristosbefore an
147*b5677b36Schristos.Em initial absolute query
148*b5677b36Schristoswill be made.  The default for
149*b5677b36Schristos.Ar n
150*b5677b36Schristosis
151*b5677b36Schristos.Dq 1 ,
152*b5677b36Schristosmeaning that if there are
153*b5677b36Schristos.Em any
154*b5677b36Schristosdots in a name, the name will be tried first as an absolute name before any
155*b5677b36Schristos.Em search list
156*b5677b36Schristoselements are appended to it.
157*b5677b36Schristos.It Li timeout: Ns Ar n
158*b5677b36Schristossets the amount of time the resolver will wait for a response from a remote
159*b5677b36Schristosname server before retrying the query via a different name server.  Measured in
160*b5677b36Schristosseconds, the default is
161*b5677b36Schristos.Dv RES_TIMEOUT
162*b5677b36Schristos(see
163*b5677b36Schristos.Pa <resolv.h> ) .
164*b5677b36Schristos.It Li attempts: Ns Ar n
165*b5677b36Schristossets the number of times the resolver will send a query to its name servers
166*b5677b36Schristosbefore giving up and returning an error to the calling application.  The
167*b5677b36Schristosdefault is
168*b5677b36Schristos.Dv RES_DFLRETRY
169*b5677b36Schristos(see
170*b5677b36Schristos.Pa <resolv.h> ) .
171*b5677b36Schristos.It Li rotate
172*b5677b36Schristossets
173*b5677b36Schristos.Dv RES_ROTATE
174*b5677b36Schristosin
175*b5677b36Schristos.Ft _res.options ,
176*b5677b36Schristoswhich causes round robin selection of nameservers from among those listed.
177*b5677b36SchristosThis has the effect of spreading the query load among all listed servers,
178*b5677b36Schristosrather than having all clients try the first listed server first every time.
179*b5677b36Schristos.It Li no-check-names
180*b5677b36Schristossets
181*b5677b36Schristos.Dv RES_NOCHECKNAME
182*b5677b36Schristosin
183*b5677b36Schristos.Ft _res.options ,
184*b5677b36Schristoswhich disables the modern BIND checking of incoming host names and mail names
185*b5677b36Schristosfor invalid characters such as underscore (_), non-ASCII, or control characters.
186*b5677b36Schristos.It Li inet6
187*b5677b36Schristossets
188*b5677b36Schristos.Dv RES_USE_INET6
189*b5677b36Schristosin
190*b5677b36Schristos.Ft _res.options .
191*b5677b36SchristosThis has the effect of trying a AAAA query before an A query inside the
192*b5677b36Schristos.Ft gethostbyname
193*b5677b36Schristosfunction, and of mapping IPv4 responses in IPv6 ``tunnelled form'' if no
194*b5677b36SchristosAAAA records are found but an A record set exists.
195*b5677b36Schristos.It Li no-tld-query
196*b5677b36Schristossets
197*b5677b36Schristos.Dv RES_NOTLDQUERY
198*b5677b36Schristosin
199*b5677b36Schristos.Ft _res.options .
200*b5677b36SchristosThis option causes
201*b5677b36Schristos.Fn res_nsearch
202*b5677b36Schristosto not attempt to resolve a unqualified name as if it were a top level
203*b5677b36Schristosdomain (TLD).
204*b5677b36SchristosThis option can cause problems if the site has "localhost" as a TLD rather
205*b5677b36Schristosthan having localhost on one or more elements of the search list.
206*b5677b36SchristosThis option has no effect if neither
207*b5677b36Schristos.Dv RES_DEFNAMES
208*b5677b36Schristosor
209*b5677b36Schristos.Dv RES_DNSRCH
210*b5677b36Schristosis set.
211*b5677b36Schristos.El
212*b5677b36Schristos.El
213*b5677b36Schristos.Pp
214*b5677b36SchristosThe
215*b5677b36Schristos.Li domain
216*b5677b36Schristosand
217*b5677b36Schristos.Li search
218*b5677b36Schristoskeywords are mutually exclusive.
219*b5677b36SchristosIf more than one instance of these keywords is present,
220*b5677b36Schristosthe last instance wins.
221*b5677b36Schristos.Pp
222*b5677b36SchristosThe
223*b5677b36Schristos.Li search
224*b5677b36Schristoskeyword of a system's
225*b5677b36Schristos.Pa resolv.conf
226*b5677b36Schristosfile can be
227*b5677b36Schristosoverridden on a per-process basis by setting the environment variable
228*b5677b36Schristos.Dq Ev LOCALDOMAIN
229*b5677b36Schristosto a space-separated list of search domains.
230*b5677b36Schristos.Pp
231*b5677b36SchristosThe
232*b5677b36Schristos.Li options
233*b5677b36Schristoskeyword of a system's
234*b5677b36Schristos.Pa resolv.conf
235*b5677b36Schristosfile can be amended on a per-process basis by setting the environment variable
236*b5677b36Schristos.Dq Ev RES_OPTIONS to a space-separated list of
237*b5677b36Schristos.Nm resolver
238*b5677b36Schristosoptions as explained above under
239*b5677b36Schristos.Li options .
240*b5677b36Schristos.Pp
241*b5677b36SchristosThe keyword and value must appear on a single line, and the keyword
242*b5677b36Schristos(e.g.,
243*b5677b36Schristos.Li nameserver )
244*b5677b36Schristosmust start the line.  The value follows the keyword, separated by white space.
245*b5677b36Schristos.Sh FILES
246*b5677b36Schristos.Pa /etc/resolv.conf
247*b5677b36Schristos.Pa <resolv.h>
248*b5677b36Schristos.Sh SEE ALSO
249*b5677b36Schristos.Xr gethostbyname 3 ,
250*b5677b36Schristos.Xr hostname 7 ,
251*b5677b36Schristos.Xr resolver 3 ,
252*b5677b36Schristos.Xr resolver 5 .
253*b5677b36Schristos.Dq Name Server Operations Guide for Sy BIND
254