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 2016-10-08 "" "Linux Programmer's Manual"
26 resolv.conf \- resolver configuration file
32 is a set of routines in the C library
33 that provide access to the Internet Domain Name System (DNS).
34 The resolver configuration file contains information that is read
35 by the resolver routines the first time they are invoked by a process.
36 The file is designed to be human readable and contains a list of
37 keywords with values that provide various types of resolver information.
38 The configuration file is considered a trusted source of DNS information
39 (e.g., DNSSEC AD-bit information will be returned unmodified from this
42 If this file does not exist,
43 only the name server on the local machine will be queried;
44 the domain name is determined from the hostname
45 and the domain search path is constructed from the domain name.
47 The different configuration options are:
49 \fBnameserver\fP Name server IP address
50 Internet address of a name server that the resolver should query,
51 either an IPv4 address (in dot notation),
52 or an IPv6 address in colon (and possibly dot) notation as per RFC 2373.
55 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
57 If there are multiple servers,
58 the resolver library queries them in the order listed.
59 If no \fBnameserver\fP entries are present,
60 the default is to use the name server on the local machine.
61 (The algorithm used is to try a name server, and if the query times out,
62 try the next, until out of name servers,
63 then repeat trying all the name servers
64 until a maximum number of retries are made.)
66 \fBdomain\fP Local domain name.
67 Most queries for names within this domain can use short names
68 relative to the local domain.
69 If set to \(aq.\(aq, the root domain is considered.
70 If no \fBdomain\fP entry is present, the domain is determined
71 from the local hostname returned by
73 the domain part is taken to be everything after the first \(aq.\(aq.
74 Finally, if the hostname does not contain a domain part, the root
77 \fBsearch\fP Search list for host-name lookup.
78 The search list is normally determined from the local domain name;
79 by default, it contains only the local domain name.
80 This may be changed by listing the desired domain search path
81 following the \fIsearch\fP keyword with spaces or tabs separating
83 Resolver queries having fewer than
85 dots (default is 1) in them will be attempted using each component
86 of the search path in turn until a match is found.
87 For environments with multiple subdomains please read
88 .BI "options ndots:" n
89 below to avoid man-in-the-middle attacks and unnecessary
90 traffic for the root-dns-servers.
91 .\" When having a resolv.conv with a line
92 .\" search subdomain.domain.tld domain.tld
93 .\" and doing a hostlookup, for example by
94 .\" ping host.anothersubdomain
95 .\" it sends dns-requests for
96 .\" host.anothersubdomain.
97 .\" host.anothersubdomain.subdomain.domain.tld.
98 .\" host.anothersubdomain.domain.tld.
99 .\" thus not only causing unnecessary traffic for the root-dns-servers
100 .\" but broadcasting information to the outside and making man-in-the-middle
101 .\" attacks possible.
102 Note that this process may be slow and will generate a lot of network
103 traffic if the servers for the listed domains are not local,
104 and that queries will time out if no server is available
105 for one of the domains.
107 The search list is currently limited to six domains
108 with a total of 256 characters.
111 This option allows addresses returned by
112 .BR gethostbyname (3)
114 A sortlist is specified by IP-address-netmask pairs.
116 optional and defaults to the natural netmask of the net.
118 and optional network pairs are separated by slashes.
124 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
129 Options allows certain internal resolver variables to be modified.
133 \fBoptions\fP \fIoption\fP \fI...\fP
135 where \fIoption\fP is one of the following:
143 (effective only if glibc was built with debug support; see
148 Sets a threshold for the number of dots which
149 must appear in a name given to
153 before an \fIinitial absolute query\fP will be made.
155 \fIn\fP is 1, meaning that if there are any dots in a name, the name
156 will be tried first as an absolute name before any \fIsearch list\fP
157 elements are appended to it.
158 The value for this option is silently capped to 15.
162 Sets the amount of time the resolver will wait for a
163 response from a remote name server before retrying the
164 query via a different name server. This may
166 be the total time taken by any resolver API call and there is no
167 guarantee that a single resolver API call maps to a single timeout.
171 (currently 5, see \fI<resolv.h>\fP).
172 The value for this option is silently capped to 30.
175 Sets the number of times the resolver will send a
176 query to its name servers before giving up and returning
177 an error to the calling application.
180 (currently 2, see \fI<resolv.h>\fP).
181 The value for this option is silently capped to 5.
189 which causes round-robin selection of name servers from among those listed.
190 This has the effect of spreading the query load among all listed servers,
191 rather than having all clients try the first listed server first every time.
199 which disables the modern BIND checking of incoming hostnames and
200 mail names for invalid characters such as underscore (_), non-ASCII,
201 or control characters.
209 This has the effect of trying an AAAA query before an A query inside the
210 .BR gethostbyname (3)
211 function, and of mapping IPv4 responses in IPv6 "tunneled form"
212 if no AAAA records are found but an A record set exists.
214 .BR ip6-bytestring " (since glibc 2.3.4)"
219 This causes reverse IPv6 lookups to be made using the bit-label format
220 described in RFC\ 2673;
221 if this option is not set, then nibble format is used.
223 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
228 When this option is clear
230 reverse IPv6 lookups are made in the (deprecated)
233 when this option is set
234 .RB ( no-ip6-dotint ),
235 reverse IPv6 lookups are made in the
238 This option is set by default.
240 .BR edns0 " (since glibc 2.6)"
245 This enables support for the DNS extensions described in RFC\ 2671.
247 .BR single-request " (since glibc 2.10)"
252 By default, glibc performs IPv4 and IPv6 lookups in parallel since
254 Some appliance DNS servers
255 cannot handle these queries properly and make the requests time out.
256 This option disables the behavior and makes glibc perform the IPv6
257 and IPv4 requests sequentially (at the cost of some slowdown of the
260 .BR single-request-reopen " (since glibc 2.9)"
265 The resolver uses the same socket for the A and AAAA requests.
266 Some hardware mistakenly sends back only one reply.
267 When that happens the client system will sit and wait for the second reply.
268 Turning this option on changes this behavior
269 so that if two requests from the same port are not handled correctly it will
270 close the socket and open a new one before sending the second request.
272 .BR no-tld-query " (since glibc 2.14)"
279 to not attempt to resolve an unqualified name
280 as if it were a top level domain (TLD).
281 This option can cause problems if the site has ``localhost'' as a TLD
282 rather than having localhost on one or more elements of the search list.
283 This option has no effect if neither RES_DEFNAMES or RES_DNSRCH is set.
285 .BR use-vc " (since glibc 2.14)"
290 This option forces the use of TCP for DNS resolutions.
293 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
294 If more than one instance of these keywords is present,
295 the last instance wins.
297 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
298 overridden on a per-process basis by setting the environment variable
300 to a space-separated list of search domains.
302 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
303 amended on a per-process basis by setting the environment variable
305 to a space-separated list of resolver options
306 as explained above under \fBoptions\fP.
308 The keyword and value must appear on a single line, and the keyword
309 (e.g., \fBnameserver\fP) must start the line.
310 The value follows the keyword, separated by white space.
312 Lines that contain a semicolon (;) or hash character (#)
313 in the first column are treated as comments.
315 .IR /etc/resolv.conf ,
318 .BR gethostbyname (3),
322 .BR nsswitch.conf (5),
326 Name Server Operations Guide for BIND