syscalls.2: wfix
[man-pages.git] / man5 / resolv.conf.5
blob7efce605b167292043b81db51adc06f56a973e98
1 .\" Copyright (c) 1986 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" %%%LICENSE_START(PERMISSIVE_MISC)
5 .\" Redistribution and use in source and binary forms are permitted
6 .\" provided that the above copyright notice and this paragraph are
7 .\" duplicated in all such forms and that any documentation,
8 .\" advertising materials, and other materials related to such
9 .\" distribution and use acknowledge that the software was developed
10 .\" by the University of California, Berkeley.  The name of the
11 .\" University may not be used to endorse or promote products derived
12 .\" from this software without specific prior written permission.
13 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 .\" %%%LICENSE_END
17 .\"
18 .\"     @(#)resolver.5  5.9 (Berkeley) 12/14/89
19 .\"     $Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $
20 .\"
21 .\" Added ndots remark by Bernhard R. Link - debian bug #182886
22 .\"
23 .TH resolv.conf 5 (date) "Linux man-pages (unreleased)"
24 .UC 4
25 .SH NAME
26 resolv.conf \- resolver configuration file
27 .SH SYNOPSIS
28 .nf
29 .B /etc/resolv.conf
30 .fi
31 .SH DESCRIPTION
32 The
33 .I resolver
34 is a set of routines in the C library
35 that provide access to the Internet Domain Name System (DNS).
36 The resolver configuration file contains information that is read
37 by the resolver routines the first time they are invoked by a process.
38 The file is designed to be human readable and contains a list of
39 keywords with values that provide various types of resolver information.
40 The configuration file is considered a trusted source of DNS information;
41 see the
42 .B trust-ad
43 option below for details.
45 If this file does not exist, only the name server on the local machine
46 will be queried, and the search list contains the local domain name
47 determined from the hostname.
49 The different configuration options are:
50 .TP
51 \fBnameserver\fP Name server IP address
52 Internet address of a name server that the resolver should query,
53 either an IPv4 address (in dot notation),
54 or an IPv6 address in colon (and possibly dot) notation as per RFC 2373.
55 Up to
56 .B MAXNS
57 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
58 one per keyword.
59 If there are multiple servers,
60 the resolver library queries them in the order listed.
61 If no \fBnameserver\fP entries are present,
62 the default is to use the name server on the local machine.
63 (The algorithm used is to try a name server, and if the query times out,
64 try the next, until out of name servers,
65 then repeat trying all the name servers
66 until a maximum number of retries are made.)
67 .TP
68 \fBsearch\fP Search list for host-name lookup.
69 By default, the search list contains one entry, the local domain name.
70 It is determined from the local hostname returned by
71 .BR gethostname (2);
72 the local domain name is taken to be everything after the first
73 \[aq].\[aq].
74 Finally, if the hostname does not contain a \[aq].\[aq], the
75 root domain is assumed as the local domain name.
76 .IP
77 This may be changed by listing the desired domain search path
78 following the \fIsearch\fP keyword with spaces or tabs separating
79 the names.
80 Resolver queries having fewer than
81 .I ndots
82 dots (default is 1) in them will be attempted using each component
83 of the search path in turn until a match is found.
84 For environments with multiple subdomains please read
85 .BI "options ndots:" n
86 below to avoid man-in-the-middle attacks and unnecessary
87 traffic for the root-dns-servers.
88 .\" When having a resolv.conv with a line
89 .\"  search subdomain.domain.tld domain.tld
90 .\" and doing a hostlookup, for example by
91 .\"  ping host.anothersubdomain
92 .\" it sends dns-requests for
93 .\"  host.anothersubdomain.
94 .\"  host.anothersubdomain.subdomain.domain.tld.
95 .\"  host.anothersubdomain.domain.tld.
96 .\" thus not only causing unnecessary traffic for the root-dns-servers
97 .\" but broadcasting information to the outside and making man-in-the-middle
98 .\" attacks possible.
99 Note that this process may be slow and will generate a lot of network
100 traffic if the servers for the listed domains are not local,
101 and that queries will time out if no server is available
102 for one of the domains.
104 If there are multiple
105 .B search
106 directives, only the search list from the last instance is used.
108 In glibc 2.25 and earlier, the search list is limited to six domains
109 with a total of 256 characters.
110 Since glibc 2.26,
111 .\" glibc commit 3f853f22c87f0b671c0366eb290919719fa56c0e
112 the search list is unlimited.
115 .B domain
116 directive is an obsolete name for the
117 .B search
118 directive that handles one search list entry only.
120 \fBsortlist\fP
121 This option allows addresses returned by
122 .BR gethostbyname (3)
123 to be sorted.
124 A sortlist is specified by IP-address-netmask pairs.
125 The netmask is
126 optional and defaults to the natural netmask of the net.
127 The IP address
128 and optional network pairs are separated by slashes.
129 Up to 10 pairs may
130 be specified.
131 Here is an example:
133 .in +4n
134 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
137 \fBoptions\fP
138 Options allows certain internal resolver variables to be modified.
139 The syntax is
142 \fBoptions\fP \fIoption\fP \fI...\fP
144 where \fIoption\fP is one of the following:
146 \fBdebug\fP
147 .\" Since glibc 2.2?
148 Sets
149 .B RES_DEBUG
151 .I _res.options
152 (effective only if glibc was built with debug support; see
153 .BR resolver (3)).
155 .BI ndots: n
156 .\" Since glibc 2.2
157 Sets a threshold for the number of dots which
158 must appear in a name given to
159 .BR res_query (3)
160 (see
161 .BR resolver (3))
162 before an \fIinitial absolute query\fP will be made.
163 The default for
164 \fIn\fP is 1, meaning that if there are any dots in a name, the name
165 will be tried first as an absolute name before any \fIsearch list\fP
166 elements are appended to it.
167 The value for this option is silently capped to 15.
169 .BI timeout: n
170 .\" Since glibc 2.2
171 Sets the amount of time the resolver will wait for a
172 response from a remote name server before retrying the
173 query via a different name server.
174 This may
175 .B not
176 be the total time taken by any resolver API call and there is no
177 guarantee that a single resolver API call maps to a single timeout.
178 Measured in seconds,
179 the default is
180 .B RES_TIMEOUT
181 (currently 5, see \fI<resolv.h>\fP).
182 The value for this option is silently capped to 30.
184 .BI attempts: n
185 Sets the number of times the resolver will send a
186 query to its name servers before giving up and returning
187 an error to the calling application.
188 The default is
189 .B RES_DFLRETRY
190 (currently 2, see \fI<resolv.h>\fP).
191 The value for this option is silently capped to 5.
193 .B rotate
194 .\" Since glibc 2.2
195 Sets
196 .B RES_ROTATE
198 .IR _res.options ,
199 which causes round-robin selection of name servers from among those listed.
200 This has the effect of spreading the query load among all listed servers,
201 rather than having all clients try the first listed server first every time.
203 .B no\-aaaa (since glibc 2.36)
204 .\" f282cdbe7f436c75864e5640a409a10485e9abb2
205 Sets
206 .B RES_NOAAAA
208 .IR _res.options ,
209 which suppresses AAAA queries made by the stub resolver,
210 including AAAA lookups triggered by NSS-based interfaces such as
211 .BR getaddrinfo (3).
212 Only DNS lookups are affected: IPv6 data in
213 .BR hosts (5)
214 is still used,
215 .BR getaddrinfo (3)
216 with
217 .B AI_PASSIVE
218 will still produce IPv6 addresses,
219 and configured IPv6 name servers are still used.
220 To produce correct Name Error (NXDOMAIN) results,
221 AAAA queries are translated to A queries.
222 This option is intended preliminary for diagnostic purposes,
223 to rule out that AAAA DNS queries have adverse impact.
224 It is incompatible with EDNS0 usage and DNSSEC validation by applications.
226 .B no\-check\-names
227 .\" since glibc 2.2
228 Sets
229 .B RES_NOCHECKNAME
231 .IR _res.options ,
232 which disables the modern BIND checking of incoming hostnames and
233 mail names for invalid characters such as underscore (_), non-ASCII,
234 or control characters.
236 .B inet6
237 .\" Since glibc 2.2
238 Sets
239 .B RES_USE_INET6
241 .IR _res.options .
242 This has the effect of trying an AAAA query before an A query inside the
243 .BR gethostbyname (3)
244 function, and of mapping IPv4 responses in IPv6 "tunneled form"
245 if no AAAA records are found but an A record set exists.
246 Since glibc 2.25,
247 .\" b76e065991ec01299225d9da90a627ebe6c1ac97
248 this option is deprecated; applications should use
249 .BR getaddrinfo (3),
250 rather than
251 .BR gethostbyname (3).
253 .BR ip6\-bytestring " (since glibc 2.3.4 to glibc 2.24)"
254 Sets
255 .B RES_USEBSTRING
257 .IR _res.options .
258 This causes reverse IPv6 lookups to be made using the bit-label format
259 described in RFC\ 2673;
260 if this option is not set (which is the default), then nibble format is used.
261 This option was removed in glibc 2.25,
262 since it relied on a backward-incompatible
263 DNS extension that was never deployed on the Internet.
265 .BR ip6\-dotint / no\-ip6\-dotint " (glibc 2.3.4 to glibc 2.24)"
266 Clear/set
267 .B RES_NOIP6DOTINT
269 .IR _res.options .
270 When this option is clear
271 .RB ( ip6\-dotint ),
272 reverse IPv6 lookups are made in the (deprecated)
273 .I ip6.int
274 zone;
275 when this option is set
276 .RB ( no\-ip6\-dotint ),
277 reverse IPv6 lookups are made in the
278 .I ip6.arpa
279 zone by default.
280 These options are available up to glibc 2.24, where
281 .B no\-ip6\-dotint
282 is the default.
283 Since
284 .B ip6\-dotint
285 support long ago ceased to be available on the Internet,
286 these options were removed in glibc 2.25.
288 .BR edns0 " (since glibc 2.6)"
289 Sets
290 .B RES_USE_EDNS0
292 .IR _res.options .
293 This enables support for the DNS extensions described in RFC\ 2671.
295 .BR single\-request " (since glibc 2.10)"
296 Sets
297 .B RES_SNGLKUP
299 .IR _res.options .
300 By default, glibc performs IPv4 and IPv6 lookups in parallel since
301 glibc 2.9.
302 Some appliance DNS servers
303 cannot handle these queries properly and make the requests time out.
304 This option disables the behavior and makes glibc perform the IPv6
305 and IPv4 requests sequentially (at the cost of some slowdown of the
306 resolving process).
308 .BR single\-request\-reopen " (since glibc 2.9)"
309 Sets
310 .B RES_SNGLKUPREOP
312 .IR _res.options .
313 The resolver uses the same socket for the A and AAAA requests.
314 Some hardware mistakenly sends back only one reply.
315 When that happens the client system will sit and wait for the second reply.
316 Turning this option on changes this behavior
317 so that if two requests from the same port are not handled correctly it will
318 close the socket and open a new one before sending the second request.
320 .BR no\-tld\-query " (since glibc 2.14)"
321 Sets
322 .B RES_NOTLDQUERY
324 .IR _res.options .
325 This option causes
326 .BR res_nsearch ()
327 to not attempt to resolve an unqualified name
328 as if it were a top level domain (TLD).
329 This option can cause problems if the site has ``localhost'' as a TLD
330 rather than having localhost on one or more elements of the search list.
331 This option has no effect if neither RES_DEFNAMES or RES_DNSRCH is set.
333 .BR use\-vc " (since glibc 2.14)"
334 Sets
335 .B RES_USEVC
337 .IR _res.options .
338 This option forces the use of TCP for DNS resolutions.
339 .\" aef16cc8a4c670036d45590877d411a97f01e0cd
341 .BR no\-reload " (since glibc 2.26)"
342 Sets
343 .B RES_NORELOAD
345 .IR _res.options .
346 This option disables automatic reloading of a changed configuration file.
348 .BR trust\-ad " (since glibc 2.31)"
349 .\" 446997ff1433d33452b81dfa9e626b8dccf101a4
350 Sets
351 .B RES_TRUSTAD
353 .IR _res.options .
354 This option controls the AD bit behavior of the stub resolver.
355 If a validating resolver sets the AD bit in a response,
356 it indicates that the data in the response was verified according
357 to the DNSSEC protocol.
358 In order to rely on the AD bit, the local system has to
359 trust both the DNSSEC-validating resolver and the network path to it,
360 which is why an explicit opt-in is required.
361 If the
362 .B trust\-ad
363 option is active, the stub resolver sets the AD bit in outgoing DNS
364 queries (to enable AD bit support), and preserves the AD bit in responses.
365 Without this option, the AD bit is not set in queries,
366 and it is always removed from responses before they are returned to the
367 application.
368 This means that applications can trust the AD bit in responses if the
369 .B trust\-ad
370 option has been set correctly.
372 In glibc 2.30 and earlier,
373 the AD is not set automatically in queries,
374 and is passed through unchanged to applications in responses.
377 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
378 overridden on a per-process basis by setting the environment variable
379 .B LOCALDOMAIN
380 to a space-separated list of search domains.
382 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
383 amended on a per-process basis by setting the environment variable
384 .B RES_OPTIONS
385 to a space-separated list of resolver options
386 as explained above under \fBoptions\fP.
388 The keyword and value must appear on a single line, and the keyword
389 (e.g., \fBnameserver\fP) must start the line.
390 The value follows the keyword, separated by white space.
392 Lines that contain a semicolon (;) or hash character (#)
393 in the first column are treated as comments.
394 .SH FILES
395 .IR /etc/resolv.conf ,
396 .I <resolv.h>
397 .SH SEE ALSO
398 .BR gethostbyname (3),
399 .BR resolver (3),
400 .BR host.conf (5),
401 .BR hosts (5),
402 .BR nsswitch.conf (5),
403 .BR hostname (7),
404 .BR named (8)
406 Name Server Operations Guide for BIND