1 .\" Copyright (c) 1986 The Regents of the University of California.
2 .\" All rights reserved.
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.
18 .\" @(#)resolver.5 5.9 (Berkeley) 12/14/89
19 .\" $Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $
21 .\" Added ndots remark by Bernhard R. Link - debian bug #182886
23 .TH resolv.conf 5 (date) "Linux man-pages (unreleased)"
26 resolv.conf \- resolver configuration file
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;
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:
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.
57 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
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.)
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
72 the local domain name is taken to be everything after the first
74 Finally, if the hostname does not contain a \[aq].\[aq], the
75 root domain is assumed as the local domain name.
77 This may be changed by listing the desired domain search path
78 following the \fIsearch\fP keyword with spaces or tabs separating
80 Resolver queries having fewer than
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
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
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.
111 .\" glibc commit 3f853f22c87f0b671c0366eb290919719fa56c0e
112 the search list is unlimited.
116 directive is an obsolete name for the
118 directive that handles one search list entry only.
121 This option allows addresses returned by
122 .BR gethostbyname (3)
124 A sortlist is specified by IP-address-netmask pairs.
126 optional and defaults to the natural netmask of the net.
128 and optional network pairs are separated by slashes.
134 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
138 Options allows certain internal resolver variables to be modified.
142 \fBoptions\fP \fIoption\fP \fI...\fP
144 where \fIoption\fP is one of the following:
152 (effective only if glibc was built with debug support; see
157 Sets a threshold for the number of dots which
158 must appear in a name given to
162 before an \fIinitial absolute query\fP will be made.
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.
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.
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.
181 (currently 5, see \fI<resolv.h>\fP).
182 The value for this option is silently capped to 30.
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.
190 (currently 2, see \fI<resolv.h>\fP).
191 The value for this option is silently capped to 5.
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
209 which suppresses AAAA queries made by the stub resolver,
210 including AAAA lookups triggered by NSS-based interfaces such as
212 Only DNS lookups are affected: IPv6 data in
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.
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.
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.
247 .\" b76e065991ec01299225d9da90a627ebe6c1ac97
248 this option is deprecated; applications should use
251 .BR gethostbyname (3).
253 .BR ip6\-bytestring " (since glibc 2.3.4 to glibc 2.24)"
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)"
270 When this option is clear
272 reverse IPv6 lookups are made in the (deprecated)
275 when this option is set
276 .RB ( no\-ip6\-dotint ),
277 reverse IPv6 lookups are made in the
280 These options are available up to glibc 2.24, where
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)"
293 This enables support for the DNS extensions described in RFC\ 2671.
295 .BR single\-request " (since glibc 2.10)"
300 By default, glibc performs IPv4 and IPv6 lookups in parallel since
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
308 .BR single\-request\-reopen " (since glibc 2.9)"
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)"
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)"
338 This option forces the use of TCP for DNS resolutions.
339 .\" aef16cc8a4c670036d45590877d411a97f01e0cd
341 .BR no\-reload " (since glibc 2.26)"
346 This option disables automatic reloading of a changed configuration file.
348 .BR trust\-ad " (since glibc 2.31)"
349 .\" 446997ff1433d33452b81dfa9e626b8dccf101a4
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.
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
368 This means that applications can trust the AD bit in responses if the
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
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
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.
395 .IR /etc/resolv.conf ,
398 .BR gethostbyname (3),
402 .BR nsswitch.conf (5),
406 Name Server Operations Guide for BIND