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 2014-12-31 "" "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.
168 (currently 5, see \fI<resolv.h>\fP).
169 The value for this option is silently capped to 30.
172 sets the number of times the resolver will send a
173 query to its name servers before giving up and returning
174 an error to the calling application.
177 (currently 2, see \fI<resolv.h>\fP).
178 The value for this option is silently capped to 5.
186 which causes round-robin selection of name servers from among those listed.
187 This has the effect of spreading the query load among all listed servers,
188 rather than having all clients try the first listed server first every time.
196 which disables the modern BIND checking of incoming hostnames and
197 mail names for invalid characters such as underscore (_), non-ASCII,
198 or control characters.
206 This has the effect of trying a AAAA query before an A query inside the
207 .BR gethostbyname (3)
208 function, and of mapping IPv4 responses in IPv6 "tunneled form"
209 if no AAAA records are found but an A record set exists.
211 .BR ip6-bytestring " (since glibc 2.3.4)"
216 This causes reverse IPv6 lookups to be made using the bit-label format
217 described in RFC\ 2673;
218 if this option is not set, then nibble format is used.
220 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
225 When this option is clear
227 reverse IPv6 lookups are made in the (deprecated)
230 when this option is set
231 .RB ( no-ip6-dotint ),
232 reverse IPv6 lookups are made in the
235 This option is set by default.
237 .BR edns0 " (since glibc 2.6)"
242 This enables support for the DNS extensions described in RFC\ 2671.
244 .BR single-request " (since glibc 2.10)"
249 By default, glibc performs IPv4 and IPv6 lookups in parallel since
251 Some appliance DNS servers
252 cannot handle these queries properly and make the requests time out.
253 This option disables the behavior and makes glibc perform the IPv6
254 and IPv4 requests sequentially (at the cost of some slowdown of the
257 .BR single-request-reopen " (since glibc 2.9)"
258 The resolver uses the same socket for the A and AAAA requests.
259 Some hardware mistakenly sends back only one reply.
260 When that happens the client system will sit and wait for the second reply.
261 Turning this option on changes this behavior
262 so that if two requests from the same port are not handled correctly it will
263 close the socket and open a new one before sending the second request.
265 .BR no-tld-query " (since glibc 2.14)"
266 sets RES_NOTLDQUERY in
270 to not attempt to resolve an unqualified name
271 as if it were a top level domain (TLD).
272 This option can cause problems if the site has ``localhost'' as a TLD
273 rather than having localhost on one or more elements of the search list.
274 This option has no effect if neither RES_DEFNAMES or RES_DNSRCH is set.
277 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
278 If more than one instance of these keywords is present,
279 the last instance wins.
281 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
282 overridden on a per-process basis by setting the environment variable
284 to a space-separated list of search domains.
286 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
287 amended on a per-process basis by setting the environment variable
289 to a space-separated list of resolver options
290 as explained above under \fBoptions\fP.
292 The keyword and value must appear on a single line, and the keyword
293 (e.g., \fBnameserver\fP) must start the line.
294 The value follows the keyword, separated by white space.
296 Lines that contain a semicolon (;) or hash character (#)
297 in the first column are treated as comments.
299 .IR /etc/resolv.conf ,
302 .BR gethostbyname (3),
307 Name Server Operations Guide for BIND
309 This page is part of release 3.78 of the Linux
312 A description of the project,
313 information about reporting bugs,
314 and the latest version of this page,
316 \%http://www.kernel.org/doc/man\-pages/.