OSDN Git Service

(split) LDP: Update original to LDP v3.53.
[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 2013-07-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 .LP
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.
43 .LP
44 The different configuration options are:
45 .TP
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.
50 Up to
51 .B MAXNS
52 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
53 one per keyword.
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.)
62 .TP
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
69 .BR gethostname (2);
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
72 domain is assumed.
73 .TP
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
79 the names.
80 Resolver queries having fewer than
81 .I ndots
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
98 .\" attacks possible.
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.
103 .IP
104 The search list is currently limited to six domains
105 with a total of 256 characters.
106 .TP
107 \fBsortlist\fP
108 This option allows addresses returned by
109 .BR gethostbyname (3)
110 to be sorted.
111 A sortlist is specified by IP-address-netmask pairs.
112 The netmask is
113 optional and defaults to the natural netmask of the net.
114 The IP address
115 and optional network pairs are separated by slashes.
116 Up to 10 pairs may
117 be specified.
118 Here is an example:
119
120 .in +4n
121 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
122 .in
123 .br
124 .TP
125 \fBoptions\fP
126 Options allows certain internal resolver variables to be modified.
127 The syntax is
128 .RS
129 .IP
130 \fBoptions\fP \fIoption\fP \fI...\fP
131 .LP
132 where \fIoption\fP is one of the following:
133 .TP
134 \fBdebug\fP
135 .\" Since glibc 2.2?
136 sets
137 .BR RES_DEBUG
138 in
139 .IR _res.options
140 (effective only if glibc was built with debug support; see
141 .BR resolver (3)).
142 .TP
143 .BI ndots: n
144 .\" Since glibc 2.2
145 sets a threshold for the number of dots which
146 must appear in a name given to
147 .BR res_query (3)
148 (see
149 .BR resolver (3))
150 before an \fIinitial absolute query\fP will be made.
151 The default for
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.
156 .TP
157 .BI timeout: n
158 .\" Since glibc 2.2
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.
162 Measured in seconds,
163 the default is
164 .BR RES_TIMEOUT
165 (currently 5, see \fI<resolv.h>\fP).
166 The value for this option is silently capped to 30.
167 .TP
168 .BI attempts: n
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.
172 The default is
173 .BR RES_DFLRETRY
174 (currently 2, see \fI<resolv.h>\fP).
175 The value for this option is silently capped to 5.
176 .TP
177 .B rotate
178 .\" Since glibc 2.2
179 sets
180 .BR RES_ROTATE
181 in
182 .IR _res.options ,
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.
186 .TP
187 .B no-check-names
188 .\" since glibc 2.2
189 sets
190 .BR RES_NOCHECKNAME
191 in
192 .IR _res.options ,
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.
196 .TP
197 .B inet6
198 .\" Since glibc 2.2
199 sets
200 .BR RES_USE_INET6
201 in
202 .IR _res.options .
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.
207 .TP
208 .BR ip6-bytestring " (since glibc 2.3.4)"
209 sets
210 .BR RES_USE_BSTRING
211 in
212 .IR _res.options .
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.
216 .TP
217 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
218 Clear/set
219 .BR RES_NOIP6DOTINT
220 in
221 .IR _res.options .
222 When this option is clear
223 .RB ( ip6-dotint ),
224 reverse IPv6 lookups are made in the (deprecated)
225 .I ip6.int
226 zone;
227 when this option is set
228 .RB ( no-ip6-dotint ),
229 reverse IPv6 lookups are made in the
230 .I ip6.arpa
231 zone by default.
232 This option is set by default.
233 .TP
234 .BR edns0 " (since glibc 2.6)"
235 sets
236 .BR RES_USE_EDNSO
237 in
238 .IR _res.options .
239 This enables support for the DNS extensions described in RFC\ 2671.
240 .TP
241 .BR single-request " (since glibc 2.10)"
242 sets
243 .BR RES_SNGLKUP
244 in
245 .IR _res.options .
246 By default, glibc performs IPv4 and IPv6 lookups in parallel since
247 version 2.9.
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
252 resolving process).
253 .TP
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.
261 .RE
262 .LP
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.
266 .LP
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
269 .B LOCALDOMAIN
270 to a space-separated list of search domains.
271 .LP
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
274 .B RES_OPTIONS
275 to a space-separated list of resolver options
276 as explained above under \fBoptions\fP.
277 .LP
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.
281
282 Lines that contain a semicolon (;) or hash character (#)
283 in the first column are treated as comments.
284 .SH FILES
285 .IR /etc/resolv.conf ,
286 .I <resolv.h>
287 .SH SEE ALSO
288 .BR gethostbyname (3),
289 .BR resolver (3),
290 .BR hostname (7),
291 .BR named (8)
292 .br
293 Name Server Operations Guide for BIND