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 2021-03-22 "" "Linux Programmer's Manual"
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.
209 which disables the modern BIND checking of incoming hostnames and
210 mail names for invalid characters such as underscore (_), non-ASCII,
211 or control characters.
219 This has the effect of trying an AAAA query before an A query inside the
220 .BR gethostbyname (3)
221 function, and of mapping IPv4 responses in IPv6 "tunneled form"
222 if no AAAA records are found but an A record set exists.
224 .\" b76e065991ec01299225d9da90a627ebe6c1ac97
225 this option is deprecated; applications should use
228 .BR gethostbyname (3).
230 .BR ip6\-bytestring " (since glibc 2.3.4 to 2.24)"
235 This causes reverse IPv6 lookups to be made using the bit-label format
236 described in RFC\ 2673;
237 if this option is not set (which is the default), then nibble format is used.
238 This option was removed in glibc 2.25,
239 since it relied on a backward-incompatible
240 DNS extension that was never deployed on the Internet.
242 .BR ip6\-dotint / no\-ip6\-dotint " (glibc 2.3.4 to 2.24)"
247 When this option is clear
249 reverse IPv6 lookups are made in the (deprecated)
252 when this option is set
253 .RB ( no\-ip6\-dotint ),
254 reverse IPv6 lookups are made in the
257 These options are available in glibc versions up to 2.24, where
262 support long ago ceased to be available on the Internet,
263 these options were removed in glibc 2.25.
265 .BR edns0 " (since glibc 2.6)"
270 This enables support for the DNS extensions described in RFC\ 2671.
272 .BR single\-request " (since glibc 2.10)"
277 By default, glibc performs IPv4 and IPv6 lookups in parallel since
279 Some appliance DNS servers
280 cannot handle these queries properly and make the requests time out.
281 This option disables the behavior and makes glibc perform the IPv6
282 and IPv4 requests sequentially (at the cost of some slowdown of the
285 .BR single\-request\-reopen " (since glibc 2.9)"
290 The resolver uses the same socket for the A and AAAA requests.
291 Some hardware mistakenly sends back only one reply.
292 When that happens the client system will sit and wait for the second reply.
293 Turning this option on changes this behavior
294 so that if two requests from the same port are not handled correctly it will
295 close the socket and open a new one before sending the second request.
297 .BR no\-tld\-query " (since glibc 2.14)"
304 to not attempt to resolve an unqualified name
305 as if it were a top level domain (TLD).
306 This option can cause problems if the site has ``localhost'' as a TLD
307 rather than having localhost on one or more elements of the search list.
308 This option has no effect if neither RES_DEFNAMES or RES_DNSRCH is set.
310 .BR use\-vc " (since glibc 2.14)"
315 This option forces the use of TCP for DNS resolutions.
316 .\" aef16cc8a4c670036d45590877d411a97f01e0cd
318 .BR no\-reload " (since glibc 2.26)"
323 This option disables automatic reloading of a changed configuration file.
325 .BR trust\-ad " (since glibc 2.31)"
326 .\" 446997ff1433d33452b81dfa9e626b8dccf101a4
331 This option controls the AD bit behavior of the stub resolver.
332 If a validating resolver sets the AD bit in a response,
333 it indicates that the data in the response was verified according
334 to the DNSSEC protocol.
335 In order to rely on the AD bit, the local system has to
336 trust both the DNSSEC-validating resolver and the network path to it,
337 which is why an explicit opt-in is required.
340 option is active, the stub resolver sets the AD bit in outgoing DNS
341 queries (to enable AD bit support), and preserves the AD bit in responses.
342 Without this option, the AD bit is not set in queries,
343 and it is always removed from responses before they are returned to the
345 This means that applications can trust the AD bit in responses if the
347 option has been set correctly.
349 In glibc version 2.30 and earlier,
350 the AD is not set automatically in queries,
351 and is passed through unchanged to applications in responses.
354 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
355 overridden on a per-process basis by setting the environment variable
357 to a space-separated list of search domains.
359 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
360 amended on a per-process basis by setting the environment variable
362 to a space-separated list of resolver options
363 as explained above under \fBoptions\fP.
365 The keyword and value must appear on a single line, and the keyword
366 (e.g., \fBnameserver\fP) must start the line.
367 The value follows the keyword, separated by white space.
369 Lines that contain a semicolon (;) or hash character (#)
370 in the first column are treated as comments.
372 .IR /etc/resolv.conf ,
375 .BR gethostbyname (3),
379 .BR nsswitch.conf (5),
383 Name Server Operations Guide for BIND