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