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-07-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.
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 set to \(aq.\(aq, the root domain is considered.
67 If no \fBdomain\fP entry is present, the domain is determined
68 from the local hostname returned by
70 the domain part is taken to be everything after the first \(aq.\(aq.
71 Finally, if the hostname does not contain a domain part, the root
74 \fBsearch\fP Search list for host-name lookup.
75 The search list is normally determined from the local domain name;
76 by default, it contains only 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 The search list is currently limited to six domains
105 with a total of 256 characters.
108 This option allows addresses returned by
109 .BR gethostbyname (3)
111 A sortlist is specified by IP-address-netmask pairs.
113 optional and defaults to the natural netmask of the net.
115 and optional network pairs are separated by slashes.
121 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
126 Options allows certain internal resolver variables to be modified.
130 \fBoptions\fP \fIoption\fP \fI...\fP
132 where \fIoption\fP is one of the following:
140 (effective only if glibc was built with debug support; see
145 sets a threshold for the number of dots which
146 must appear in a name given to
150 before an \fIinitial absolute query\fP will be made.
152 \fIn\fP is 1, meaning that if there are any dots in a name, the name
153 will be tried first as an absolute name before any \fIsearch list\fP
154 elements are appended to it.
155 The value for this option is silently capped to 15.
159 sets the amount of time the resolver will wait for a
160 response from a remote name server before retrying the
161 query via a different name server.
165 (currently 5, see \fI<resolv.h>\fP).
166 The value for this option is silently capped to 30.
169 sets the number of times the resolver will send a
170 query to its name servers before giving up and returning
171 an error to the calling application.
174 (currently 2, see \fI<resolv.h>\fP).
175 The value for this option is silently capped to 5.
183 which causes round-robin selection of nameservers from among those listed.
184 This has the effect of spreading the query load among all listed servers,
185 rather than having all clients try the first listed server first every time.
193 which disables the modern BIND checking of incoming hostnames and
194 mail names for invalid characters such as underscore (_), non-ASCII,
195 or control characters.
203 This has the effect of trying a AAAA query before an A query inside the
204 .BR gethostbyname (3)
205 function, and of mapping IPv4 responses in IPv6 "tunneled form"
206 if no AAAA records are found but an A record set exists.
208 .BR ip6-bytestring " (since glibc 2.3.4)"
213 This causes reverse IPv6 lookups to be made using the bit-label format
214 described in RFC\ 2673;
215 if this option is not set, then nibble format is used.
217 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
222 When this option is clear
224 reverse IPv6 lookups are made in the (deprecated)
227 when this option is set
228 .RB ( no-ip6-dotint ),
229 reverse IPv6 lookups are made in the
232 This option is set by default.
234 .BR edns0 " (since glibc 2.6)"
239 This enables support for the DNS extensions described in RFC\ 2671.
241 .BR single-request " (since glibc 2.10)"
246 By default, glibc performs IPv4 and IPv6 lookups in parallel since
248 Some appliance DNS servers
249 cannot handle these queries properly and make the requests time out.
250 This option disables the behavior and makes glibc perform the IPv6
251 and IPv4 requests sequentially (at the cost of some slowdown of the
254 .BR single-request-reopen " (since glibc 2.9)"
255 The resolver uses the same socket for the A and AAAA requests.
256 Some hardware mistakenly sends back only one reply.
257 When that happens the client system will sit and wait for the second reply.
258 Turning this option on changes this behavior
259 so that if two requests from the same port are not handled correctly it will
260 close the socket and open a new one before sending the second request.
263 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
264 If more than one instance of these keywords is present,
265 the last instance wins.
267 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
268 overridden on a per-process basis by setting the environment variable
270 to a space-separated list of search domains.
272 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
273 amended on a per-process basis by setting the environment variable
275 to a space-separated list of resolver options
276 as explained above under \fBoptions\fP.
278 The keyword and value must appear on a single line, and the keyword
279 (e.g., \fBnameserver\fP) must start the line.
280 The value follows the keyword, separated by white space.
282 Lines that contain a semicolon (;) or hash character (#)
283 in the first column are treated as comments.
285 .IR /etc/resolv.conf ,
288 .BR gethostbyname (3),
293 Name Server Operations Guide for BIND