1 .\" Copyright (c) 1986 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms are permitted
5 .\" provided that the above copyright notice and this paragraph are
6 .\" duplicated in all such forms and that any documentation,
7 .\" advertising materials, and other materials related to such
8 .\" distribution and use acknowledge that the software was developed
9 .\" by the University of California, Berkeley. The name of the
10 .\" University may not be used to endorse or promote products derived
11 .\" from this software without specific prior written permission.
12 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 .\" @(#)resolver.5 5.9 (Berkeley) 12/14/89
17 .\" $Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $
19 .\" Added ndots remark by Bernhard R. Link - debian bug #182886
21 .TH RESOLV.CONF 5 2009-03-01 "" "Linux Programmer's Manual"
24 resolv.conf \- resolver configuration file
30 is a set of routines in the C library
31 that provide access to the Internet Domain Name System (DNS).
32 The resolver configuration file contains information that is read
33 by the resolver routines the first time they are invoked by a process.
34 The file is designed to be human readable and contains a list of
35 keywords with values that provide various types of resolver information.
37 On a normally configured system this file should not be necessary.
38 The only name server to be queried will be on the local machine;
39 the domain name is determined from the hostname
40 and the domain search path is constructed from the domain name.
42 The different configuration options are:
44 \fBnameserver\fP Name server IP address
45 Internet address (in dot notation) of a name server
46 that the resolver should query.
49 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
51 If there are multiple servers,
52 the resolver library queries them in the order listed.
53 If no \fBnameserver\fP entries are present,
54 the default is to use the name server on the local machine.
55 (The algorithm used is to try a name server, and if the query times out,
56 try the next, until out of name servers,
57 then repeat trying all the name servers
58 until a maximum number of retries are made.)
60 \fBdomain\fP Local domain name.
61 Most queries for names within this domain can use short names
62 relative to the local domain.
63 If no \fBdomain\fP entry is present, the domain is determined
64 from the local hostname returned by
66 the domain part is taken to be everything after the first \(aq.\(aq.
67 Finally, if the hostname does not contain a domain part, the root
70 \fBsearch\fP Search list for host-name lookup.
71 The search list is normally determined from the local domain name;
72 by default, it contains only the local domain name.
73 This may be changed by listing the desired domain search path
74 following the \fIsearch\fP keyword with spaces or tabs separating
76 Resolver queries having fewer than
78 dots (default is 1) in them will be attempted using each component
79 of the search path in turn until a match is found.
80 For environments with multiple subdomains please read
81 .BI "options ndots:" n
82 below to avoid man-in-the-middle attacks and unnecessary
83 traffic for the root-dns-servers.
84 .\" When having a resolv.conv with a line
85 .\" search subdomain.domain.tld domain.tld
86 .\" and doing a hostlookup, for example by
87 .\" ping host.anothersubdomain
88 .\" it sends dns-requests for
89 .\" host.anothersubdomain.
90 .\" host.anothersubdomain.subdomain.domain.tld.
91 .\" host.anothersubdomain.domain.tld.
92 .\" thus not only causing unnecessary traffic for the root-dns-servers
93 .\" but broadcasting information to the outside and making man-in-the-middle
95 Note that this process may be slow and will generate a lot of network
96 traffic if the servers for the listed domains are not local,
97 and that queries will time out if no server is available
98 for one of the domains.
100 The search list is currently limited to six domains
101 with a total of 256 characters.
104 This option allows addresses returned by
105 .BR gethostbyname (3)
107 A sortlist is specified by IP-address-netmask pairs.
109 optional and defaults to the natural netmask of the net.
111 and optional network pairs are separated by slashes.
117 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
122 Options allows certain internal resolver variables to be modified.
126 \fBoptions\fP \fIoption\fP \fI...\fP
128 where \fIoption\fP is one of the following:
139 sets a threshold for the number of dots which
140 must appear in a name given to
144 before an \fIinitial absolute query\fP will be made.
146 \fIn\fP is 1, meaning that if there are any dots in a name, the name
147 will be tried first as an absolute name before any \fIsearch list\fP
148 elements are appended to it.
149 The value for this option is silently capped to 15.
153 sets the amount of time the resolver will wait for a
154 response from a remote name server before retrying the
155 query via a different name server.
159 (currently 5, see \fI<resolv.h>\fP).
160 The value for this option is silently capped to 30.
163 sets the number of times the resolver will send a
164 query to its name servers before giving up and returning
165 an error to the calling application.
168 (currently 2, see \fI<resolv.h>\fP).
169 The value for this option is silently capped to 5.
177 which causes round robin selection of nameservers from among those listed.
178 This has the effect of spreading the query load among all listed servers,
179 rather than having all clients try the first listed server first every time.
187 which disables the modern BIND checking of incoming hostnames and
188 mail names for invalid characters such as underscore (_), non-ASCII,
189 or control characters.
197 This has the effect of trying a AAAA query before an A query inside the
198 .BR gethostbyname (3)
199 function, and of mapping IPv4 responses in IPv6 "tunneled form"
200 if no AAAA records are found but an A record set exists.
202 .BR ip6-bytestring " (since glibc 2.3.4)"
207 This causes reverse IPv6 lookups to be made using the bit-label format
208 described in RFC\ 2673;
209 if this option is not set, then nibble format is used.
211 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
216 When this option is clear
218 reverse IPv6 lookups are made in the (deprecated)
221 when this option is set
222 .RB ( no-ip6-dotint ),
223 reverse IPv6 lookups are made in the
226 This option is set by default.
228 .BR edns0 " (since glibc 2.6)"
233 This enables support for the DNS extensions described in RFC\ 2671.
236 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
237 If more than one instance of these keywords is present,
238 the last instance wins.
240 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
241 overridden on a per-process basis by setting the environment variable
243 to a space-separated list of search domains.
245 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
246 amended on a per-process basis by setting the environment variable
248 to a space-separated list of resolver options
249 as explained above under \fBoptions\fP.
251 The keyword and value must appear on a single line, and the keyword
252 (e.g., \fBnameserver\fP) must start the line.
253 The value follows the keyword, separated by white space.
255 .IR /etc/resolv.conf ,
258 .BR gethostbyname (3),
263 Name Server Operations Guide for BIND