OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man5 / resolv.conf.5
1 .\" Copyright (c) 1986 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
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.
16 .\" %%%LICENSE_END
17 .\"
18 .\"     @(#)resolver.5  5.9 (Berkeley) 12/14/89
19 .\"     $Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $
20 .\"
21 .\" Added ndots remark by Bernhard R. Link - debian bug #182886
22 .\"
23 .TH RESOLV.CONF 5 2014-12-31 "" "Linux Programmer's Manual"
24 .UC 4
25 .SH NAME
26 resolv.conf \- resolver configuration file
27 .SH SYNOPSIS
28 .B /etc/resolv.conf
29 .SH DESCRIPTION
30 The
31 .I resolver
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
40 source).
41 .LP
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.
46 .LP
47 The different configuration options are:
48 .TP
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.
53 Up to
54 .B MAXNS
55 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
56 one per keyword.
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.)
65 .TP
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
72 .BR gethostname (2);
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
75 domain is assumed.
76 .TP
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
82 the names.
83 Resolver queries having fewer than
84 .I ndots
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.
106 .IP
107 The search list is currently limited to six domains
108 with a total of 256 characters.
109 .TP
110 \fBsortlist\fP
111 This option allows addresses returned by
112 .BR gethostbyname (3)
113 to be sorted.
114 A sortlist is specified by IP-address-netmask pairs.
115 The netmask is
116 optional and defaults to the natural netmask of the net.
117 The IP address
118 and optional network pairs are separated by slashes.
119 Up to 10 pairs may
120 be specified.
121 Here is an example:
122
123 .in +4n
124 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
125 .in
126 .br
127 .TP
128 \fBoptions\fP
129 Options allows certain internal resolver variables to be modified.
130 The syntax is
131 .RS
132 .IP
133 \fBoptions\fP \fIoption\fP \fI...\fP
134 .LP
135 where \fIoption\fP is one of the following:
136 .TP
137 \fBdebug\fP
138 .\" Since glibc 2.2?
139 sets
140 .BR RES_DEBUG
141 in
142 .IR _res.options
143 (effective only if glibc was built with debug support; see
144 .BR resolver (3)).
145 .TP
146 .BI ndots: n
147 .\" Since glibc 2.2
148 sets a threshold for the number of dots which
149 must appear in a name given to
150 .BR res_query (3)
151 (see
152 .BR resolver (3))
153 before an \fIinitial absolute query\fP will be made.
154 The default for
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.
159 .TP
160 .BI timeout: n
161 .\" Since glibc 2.2
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.
165 Measured in seconds,
166 the default is
167 .BR RES_TIMEOUT
168 (currently 5, see \fI<resolv.h>\fP).
169 The value for this option is silently capped to 30.
170 .TP
171 .BI attempts: n
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.
175 The default is
176 .BR RES_DFLRETRY
177 (currently 2, see \fI<resolv.h>\fP).
178 The value for this option is silently capped to 5.
179 .TP
180 .B rotate
181 .\" Since glibc 2.2
182 sets
183 .BR RES_ROTATE
184 in
185 .IR _res.options ,
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.
189 .TP
190 .B no-check-names
191 .\" since glibc 2.2
192 sets
193 .BR RES_NOCHECKNAME
194 in
195 .IR _res.options ,
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.
199 .TP
200 .B inet6
201 .\" Since glibc 2.2
202 sets
203 .BR RES_USE_INET6
204 in
205 .IR _res.options .
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.
210 .TP
211 .BR ip6-bytestring " (since glibc 2.3.4)"
212 sets
213 .BR RES_USE_BSTRING
214 in
215 .IR _res.options .
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.
219 .TP
220 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
221 Clear/set
222 .BR RES_NOIP6DOTINT
223 in
224 .IR _res.options .
225 When this option is clear
226 .RB ( ip6-dotint ),
227 reverse IPv6 lookups are made in the (deprecated)
228 .I ip6.int
229 zone;
230 when this option is set
231 .RB ( no-ip6-dotint ),
232 reverse IPv6 lookups are made in the
233 .I ip6.arpa
234 zone by default.
235 This option is set by default.
236 .TP
237 .BR edns0 " (since glibc 2.6)"
238 sets
239 .BR RES_USE_EDNSO
240 in
241 .IR _res.options .
242 This enables support for the DNS extensions described in RFC\ 2671.
243 .TP
244 .BR single-request " (since glibc 2.10)"
245 sets
246 .BR RES_SNGLKUP
247 in
248 .IR _res.options .
249 By default, glibc performs IPv4 and IPv6 lookups in parallel since
250 version 2.9.
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
255 resolving process).
256 .TP
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.
264 .TP
265 .BR no-tld-query " (since glibc 2.14)"
266 sets RES_NOTLDQUERY in
267 .IR _res.options .
268 This option causes
269 .BR res_nsearch ()
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.
275 .RE
276 .LP
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.
280 .LP
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
283 .B LOCALDOMAIN
284 to a space-separated list of search domains.
285 .LP
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
288 .B RES_OPTIONS
289 to a space-separated list of resolver options
290 as explained above under \fBoptions\fP.
291 .LP
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.
295
296 Lines that contain a semicolon (;) or hash character (#)
297 in the first column are treated as comments.
298 .SH FILES
299 .IR /etc/resolv.conf ,
300 .I <resolv.h>
301 .SH SEE ALSO
302 .BR gethostbyname (3),
303 .BR resolver (3),
304 .BR hostname (7),
305 .BR named (8)
306 .br
307 Name Server Operations Guide for BIND
308 .SH COLOPHON
309 This page is part of release 3.79 of the Linux
310 .I man-pages
311 project.
312 A description of the project,
313 information about reporting bugs,
314 and the latest version of this page,
315 can be found at
316 \%http://www.kernel.org/doc/man\-pages/.