]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man5/resolver.5
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man5 / resolver.5
1 .\" Copyright (c) 1986, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)resolver.5  8.1 (Berkeley) 6/5/93
33 .\" $FreeBSD$
34 .\"
35 .Dd September 9, 2004
36 .Dt RESOLVER 5
37 .Os
38 .Sh NAME
39 .Nm resolver
40 .Nd resolver configuration file
41 .Sh SYNOPSIS
42 .Nm resolv.conf
43 .Sh DESCRIPTION
44 The
45 .Xr resolver 3
46 is a set of routines in the C library
47 which provide access to the Internet Domain Name System.
48 The resolver configuration file contains information that is read
49 by the resolver routines the first time they are invoked by a process.
50 The file is designed to be human readable and contains a list of
51 keywords with values that provide various types of resolver information.
52 .Pp
53 On a normally configured system this file should not be necessary.
54 The only name server to be queried will be on the local machine,
55 the domain name is determined from the host name,
56 and the domain search path is constructed from the domain name.
57 .Pp
58 The different configuration options are:
59 .Bl -tag -width nameserver
60 .It Sy nameserver
61 Internet address (in dot notation) of a name server
62 that the resolver should query.
63 Up to
64 .Dv MAXNS
65 (currently 3) name servers may be listed,
66 one per keyword.
67 If there are multiple servers,
68 the resolver library queries them in the order listed.
69 If no
70 .Sy nameserver
71 entries are present,
72 the default is to use the name server on the local machine.
73 (The algorithm used is to try a name server, and if the query times out,
74 try the next, until out of name servers,
75 then repeat trying all the name servers
76 until a maximum number of retries are made).
77 .It Sy domain
78 Local domain name.
79 Most queries for names within this domain can use short names
80 relative to the local domain.
81 If no
82 .Sy domain
83 entry is present, the domain is determined
84 from the local host name returned by
85 .Xr gethostname 3 ;
86 the domain part is taken to be everything after the first
87 .Ql \&. .
88 Finally, if the host name does not contain a domain part, the root
89 domain is assumed.
90 .It Sy search
91 Search list for host-name lookup.
92 The search list is normally determined from the local domain name;
93 by default, it contains only the local domain name.
94 This may be changed by listing the desired domain search path
95 following the
96 .Sy search
97 keyword with spaces or tabs separating
98 the names.
99 Most resolver queries will be attempted using each component
100 of the search path in turn until a match is found.
101 Note that this process may be slow and will generate a lot of network
102 traffic if the servers for the listed domains are not local,
103 and that queries will time out if no server is available
104 for one of the domains.
105 .Pp
106 The search list is currently limited to six domains
107 with a total of 256 characters.
108 .It Sy sortlist
109 Sortlist allows addresses returned by gethostbyname to be sorted.
110 A sortlist is specified by IP address netmask pairs.
111 The netmask is
112 optional and defaults to the natural netmask of the net.
113 The IP address
114 and optional network pairs are separated by slashes.
115 Up to 10 pairs may
116 be specified.
117 E.g.,
118 .Pp
119 .Dl "sortlist 130.155.160.0/255.255.240.0 130.155.0.0"
120 .It Sy options
121 Options allows certain internal resolver variables to be modified.
122 The syntax is
123 .Pp
124 \fBoptions\fP \fIoption\fP \fI...\fP
125 .Pp
126 where
127 .Sy option
128 is one of the following:
129 .Bl -tag -width no_tld_query
130 .It Sy debug
131 sets
132 .Dv RES_DEBUG
133 in _res.options.
134 .It Sy ndots: Ns Ar n
135 sets a threshold for the number of dots which must appear in a name given to
136 .Fn res_query
137 (see
138 .Xr resolver 3 )
139 before an
140 .Em initial absolute query
141 will be made.
142 The default for
143 .Em n
144 is
145 .Dq 1 ,
146 meaning that if there are any dots in a name, the name
147 will be tried first as an absolute name before any
148 .Em search list
149 elements are appended to it.
150 .It Sy timeout: Ns Ar n
151 sets the initial amount of time the resolver will wait
152 for a response from a remote
153 name server before retrying the query via a different name server.
154 The resolver may wait longer during subsequent retries
155 of the current query since an exponential back-off is applied to
156 the timeout value.
157 Measured in seconds, the default is
158 .Dv RES_TIMEOUT ,
159 the allowed maximum is
160 .Dv RES_MAXRETRANS
161 (see
162 .In resolv.h ) .
163 .It Sy attempts: Ns Ar n
164 sets the number of times the resolver will send a query to each of
165 its name servers
166 before giving up and returning an error to the calling application.
167 The default is
168 .Dv RES_DFLRETRY ,
169 the allowed maximum is
170 .Dv RES_MAXRETRY
171 (see
172 .In resolv.h ) .
173 .It Sy no_tld_query
174 tells the resolver not to attempt to resolve a top level domain name, that
175 is, a name that contains no dots.
176 Use of this option does not prevent
177 the resolver from obeying the standard
178 .Sy domain
179 and
180 .Sy search
181 rules with the given name.
182 .El
183 .Pp
184 Options may also be specified as a space or tab separated list using the
185 .Dv RES_OPTIONS
186 environment variable.
187 .El
188 .Pp
189 The
190 .Sy domain
191 and
192 .Sy search
193 keywords are mutually exclusive.
194 If more than one instance of these keywords is present,
195 the last instance will override.
196 .Pp
197 The keyword and value must appear on a single line, and the keyword
198 (e.g.\&
199 .Sy nameserver )
200 must start the line.
201 The value follows the keyword, separated by white space.
202 .Sh FILES
203 .Bl -tag -width /etc/resolv.conf -compact
204 .It Pa /etc/resolv.conf
205 The file
206 .Nm resolv.conf
207 resides in
208 .Pa /etc .
209 .El
210 .Sh SEE ALSO
211 .Xr gethostbyname 3 ,
212 .Xr resolver 3 ,
213 .Xr hostname 7 ,
214 .Xr named 8
215 .Rs
216 .%T "Name Server Operations Guide for BIND"
217 .Re
218 .Sh HISTORY
219 The
220 .Nm resolv.conf
221 file format appeared in
222 .Bx 4.3 .