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 2013-03-05 "" "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.
39 If this file does not exist,
40 only the name server on the local machine will be queried;
41 the domain name is determined from the hostname
42 and the domain search path is constructed from the domain name.
44 The different configuration options are:
46 \fBnameserver\fP Name server IP address
47 Internet address of a name server that the resolver should query,
48 either an IPv4 address (in dot notation),
49 or an IPv6 address in colon (and possibly dot) notation as per RFC 2373.
52 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
54 If there are multiple servers,
55 the resolver library queries them in the order listed.
56 If no \fBnameserver\fP entries are present,
57 the default is to use the name server on the local machine.
58 (The algorithm used is to try a name server, and if the query times out,
59 try the next, until out of name servers,
60 then repeat trying all the name servers
61 until a maximum number of retries are made.)
63 \fBdomain\fP Local domain name.
64 Most queries for names within this domain can use short names
65 relative to the local domain.
66 If no \fBdomain\fP entry is present, the domain is determined
67 from the local hostname returned by
69 the domain part is taken to be everything after the first \(aq.\(aq.
70 Finally, if the hostname does not contain a domain part, the root
73 \fBsearch\fP Search list for host-name lookup.
74 The search list is normally determined from the local domain name;
75 by default, it contains only the local domain name.
76 This may be changed by listing the desired domain search path
77 following the \fIsearch\fP keyword with spaces or tabs separating
79 Resolver queries having fewer than
81 dots (default is 1) in them will be attempted using each component
82 of the search path in turn until a match is found.
83 For environments with multiple subdomains please read
84 .BI "options ndots:" n
85 below to avoid man-in-the-middle attacks and unnecessary
86 traffic for the root-dns-servers.
87 .\" When having a resolv.conv with a line
88 .\" search subdomain.domain.tld domain.tld
89 .\" and doing a hostlookup, for example by
90 .\" ping host.anothersubdomain
91 .\" it sends dns-requests for
92 .\" host.anothersubdomain.
93 .\" host.anothersubdomain.subdomain.domain.tld.
94 .\" host.anothersubdomain.domain.tld.
95 .\" thus not only causing unnecessary traffic for the root-dns-servers
96 .\" but broadcasting information to the outside and making man-in-the-middle
98 Note that this process may be slow and will generate a lot of network
99 traffic if the servers for the listed domains are not local,
100 and that queries will time out if no server is available
101 for one of the domains.
103 The search list is currently limited to six domains
104 with a total of 256 characters.
107 This option allows addresses returned by
108 .BR gethostbyname (3)
110 A sortlist is specified by IP-address-netmask pairs.
112 optional and defaults to the natural netmask of the net.
114 and optional network pairs are separated by slashes.
120 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
125 Options allows certain internal resolver variables to be modified.
129 \fBoptions\fP \fIoption\fP \fI...\fP
131 where \fIoption\fP is one of the following:
139 (effective only if glibc was built with debug support; see
144 sets a threshold for the number of dots which
145 must appear in a name given to
149 before an \fIinitial absolute query\fP will be made.
151 \fIn\fP is 1, meaning that if there are any dots in a name, the name
152 will be tried first as an absolute name before any \fIsearch list\fP
153 elements are appended to it.
154 The value for this option is silently capped to 15.
158 sets the amount of time the resolver will wait for a
159 response from a remote name server before retrying the
160 query via a different name server.
164 (currently 5, see \fI<resolv.h>\fP).
165 The value for this option is silently capped to 30.
168 sets the number of times the resolver will send a
169 query to its name servers before giving up and returning
170 an error to the calling application.
173 (currently 2, see \fI<resolv.h>\fP).
174 The value for this option is silently capped to 5.
182 which causes round-robin selection of nameservers from among those listed.
183 This has the effect of spreading the query load among all listed servers,
184 rather than having all clients try the first listed server first every time.
192 which disables the modern BIND checking of incoming hostnames and
193 mail names for invalid characters such as underscore (_), non-ASCII,
194 or control characters.
202 This has the effect of trying a AAAA query before an A query inside the
203 .BR gethostbyname (3)
204 function, and of mapping IPv4 responses in IPv6 "tunneled form"
205 if no AAAA records are found but an A record set exists.
207 .BR ip6-bytestring " (since glibc 2.3.4)"
212 This causes reverse IPv6 lookups to be made using the bit-label format
213 described in RFC\ 2673;
214 if this option is not set, then nibble format is used.
216 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
221 When this option is clear
223 reverse IPv6 lookups are made in the (deprecated)
226 when this option is set
227 .RB ( no-ip6-dotint ),
228 reverse IPv6 lookups are made in the
231 This option is set by default.
233 .BR edns0 " (since glibc 2.6)"
238 This enables support for the DNS extensions described in RFC\ 2671.
240 .BR single-request " (since glibc 2.10)"
245 By default, glibc performs IPv4 and IPv6 lookups in parallel since
247 Some appliance DNS servers
248 cannot handle these queries properly and make the requests time out.
249 This option disables the behavior and makes glibc perform the IPv6
250 and IPv4 requests sequentially (at the cost of some slowdown of the
253 .BR single-request-reopen " (since glibc 2.9)"
254 The resolver uses the same socket for the A and AAAA requests.
255 Some hardware mistakenly sends back only one reply.
256 When that happens the client system will sit and wait for the second reply.
257 Turning this option on changes this behavior
258 so that if two requests from the same port are not handled correctly it will
259 close the socket and open a new one before sending the second request.
262 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
263 If more than one instance of these keywords is present,
264 the last instance wins.
266 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
267 overridden on a per-process basis by setting the environment variable
269 to a space-separated list of search domains.
271 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
272 amended on a per-process basis by setting the environment variable
274 to a space-separated list of resolver options
275 as explained above under \fBoptions\fP.
277 The keyword and value must appear on a single line, and the keyword
278 (e.g., \fBnameserver\fP) must start the line.
279 The value follows the keyword, separated by white space.
281 Lines that contain a semicolon (;) or hash character (#)
282 in the first column are treated as comments.
284 .IR /etc/resolv.conf ,
287 .BR gethostbyname (3),
292 Name Server Operations Guide for BIND