OSDN Git Service

(split) LDP: Update original to LDP v3.51.
[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-03-05 "" "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 no \fBdomain\fP entry is present, the domain is determined
67 from the local hostname returned by
68 .BR gethostname (2);
69 the domain part is taken to be everything after the first \(aq.\(aq.
70 Finally, if the hostname does not contain a domain part, the root
71 domain is assumed.
72 .TP
73 \fBsearch\fP Search list for host-name lookup.
74 The search list is normally determined from the local domain name;
75 by default, it contains only the local domain name.
76 This may be changed by listing the desired domain search path
77 following the \fIsearch\fP keyword with spaces or tabs separating
78 the names.
79 Resolver queries having fewer than
80 .I ndots
81 dots (default is 1) in them will be attempted using each component
82 of the search path in turn until a match is found.
83 For environments with multiple subdomains please read
84 .BI "options ndots:" n
85 below to avoid man-in-the-middle attacks and unnecessary
86 traffic for the root-dns-servers.
87 .\" When having a resolv.conv with a line
88 .\"  search subdomain.domain.tld domain.tld
89 .\" and doing a hostlookup, for example by
90 .\"  ping host.anothersubdomain
91 .\" it sends dns-requests for
92 .\"  host.anothersubdomain.
93 .\"  host.anothersubdomain.subdomain.domain.tld.
94 .\"  host.anothersubdomain.domain.tld.
95 .\" thus not only causing unnecessary traffic for the root-dns-servers
96 .\" but broadcasting information to the outside and making man-in-the-middle
97 .\" attacks possible.
98 Note that this process may be slow and will generate a lot of network
99 traffic if the servers for the listed domains are not local,
100 and that queries will time out if no server is available
101 for one of the domains.
102 .IP
103 The search list is currently limited to six domains
104 with a total of 256 characters.
105 .TP
106 \fBsortlist\fP
107 This option allows addresses returned by
108 .BR gethostbyname (3)
109 to be sorted.
110 A sortlist is specified by IP-address-netmask pairs.
111 The netmask is
112 optional and defaults to the natural netmask of the net.
113 The IP address
114 and optional network pairs are separated by slashes.
115 Up to 10 pairs may
116 be specified.
117 Here is an example:
118
119 .in +4n
120 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
121 .in
122 .br
123 .TP
124 \fBoptions\fP
125 Options allows certain internal resolver variables to be modified.
126 The syntax is
127 .RS
128 .IP
129 \fBoptions\fP \fIoption\fP \fI...\fP
130 .LP
131 where \fIoption\fP is one of the following:
132 .TP
133 \fBdebug\fP
134 .\" Since glibc 2.2?
135 sets
136 .BR RES_DEBUG
137 in
138 .IR _res.options
139 (effective only if glibc was built with debug support; see
140 .BR resolver (3)).
141 .TP
142 .BI ndots: n
143 .\" Since glibc 2.2
144 sets a threshold for the number of dots which
145 must appear in a name given to
146 .BR res_query (3)
147 (see
148 .BR resolver (3))
149 before an \fIinitial absolute query\fP will be made.
150 The default for
151 \fIn\fP is 1, meaning that if there are any dots in a name, the name
152 will be tried first as an absolute name before any \fIsearch list\fP
153 elements are appended to it.
154 The value for this option is silently capped to 15.
155 .TP
156 .BI timeout: n
157 .\" Since glibc 2.2
158 sets the amount of time the resolver will wait for a
159 response from a remote name server before retrying the
160 query via a different name server.
161 Measured in seconds,
162 the default is
163 .BR RES_TIMEOUT
164 (currently 5, see \fI<resolv.h>\fP).
165 The value for this option is silently capped to 30.
166 .TP
167 .BI attempts: n
168 sets the number of times the resolver will send a
169 query to its name servers before giving up and returning
170 an error to the calling application.
171 The default is
172 .BR RES_DFLRETRY
173 (currently 2, see \fI<resolv.h>\fP).
174 The value for this option is silently capped to 5.
175 .TP
176 .B rotate
177 .\" Since glibc 2.2
178 sets
179 .BR RES_ROTATE
180 in
181 .IR _res.options ,
182 which causes round-robin selection of nameservers from among those listed.
183 This has the effect of spreading the query load among all listed servers,
184 rather than having all clients try the first listed server first every time.
185 .TP
186 .B no-check-names
187 .\" since glibc 2.2
188 sets
189 .BR RES_NOCHECKNAME
190 in
191 .IR _res.options ,
192 which disables the modern BIND checking of incoming hostnames and
193 mail names for invalid characters such as underscore (_), non-ASCII,
194 or control characters.
195 .TP
196 .B inet6
197 .\" Since glibc 2.2
198 sets
199 .BR RES_USE_INET6
200 in
201 .IR _res.options .
202 This has the effect of trying a AAAA query before an A query inside the
203 .BR gethostbyname (3)
204 function, and of mapping IPv4 responses in IPv6 "tunneled form"
205 if no AAAA records are found but an A record set exists.
206 .TP
207 .BR ip6-bytestring " (since glibc 2.3.4)"
208 sets
209 .BR RES_USE_BSTRING
210 in
211 .IR _res.options .
212 This causes reverse IPv6 lookups to be made using the bit-label format
213 described in RFC\ 2673;
214 if this option is not set, then nibble format is used.
215 .TP
216 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
217 Clear/set
218 .BR RES_NOIP6DOTINT
219 in
220 .IR _res.options .
221 When this option is clear
222 .RB ( ip6-dotint ),
223 reverse IPv6 lookups are made in the (deprecated)
224 .I ip6.int
225 zone;
226 when this option is set
227 .RB ( no-ip6-dotint ),
228 reverse IPv6 lookups are made in the
229 .I ip6.arpa
230 zone by default.
231 This option is set by default.
232 .TP
233 .BR edns0 " (since glibc 2.6)"
234 sets
235 .BR RES_USE_EDNSO
236 in
237 .IR _res.options .
238 This enables support for the DNS extensions described in RFC\ 2671.
239 .TP
240 .BR single-request " (since glibc 2.10)"
241 sets
242 .BR RES_SNGLKUP
243 in
244 .IR _res.options .
245 By default, glibc performs IPv4 and IPv6 lookups in parallel since
246 version 2.9.
247 Some appliance DNS servers
248 cannot handle these queries properly and make the requests time out.
249 This option disables the behavior and makes glibc perform the IPv6
250 and IPv4 requests sequentially (at the cost of some slowdown of the
251 resolving process).
252 .TP
253 .BR single-request-reopen " (since glibc 2.9)"
254 The resolver uses the same socket for the A and AAAA requests.
255 Some hardware mistakenly sends back only one reply.
256 When that happens the client system will sit and wait for the second reply.
257 Turning this option on changes this behavior
258 so that if two requests from the same port are not handled correctly it will
259 close the  socket and open a new one before sending the second request.
260 .RE
261 .LP
262 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
263 If more than one instance of these keywords is present,
264 the last instance wins.
265 .LP
266 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
267 overridden on a per-process basis by setting the environment variable
268 .B LOCALDOMAIN
269 to a space-separated list of search domains.
270 .LP
271 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
272 amended on a per-process basis by setting the environment variable
273 .B RES_OPTIONS
274 to a space-separated list of resolver options
275 as explained above under \fBoptions\fP.
276 .LP
277 The keyword and value must appear on a single line, and the keyword
278 (e.g., \fBnameserver\fP) must start the line.
279 The value follows the keyword, separated by white space.
280
281 Lines that contain a semicolon (;) or hash character (#)
282 in the first column are treated as comments.
283 .SH FILES
284 .IR /etc/resolv.conf ,
285 .I <resolv.h>
286 .SH SEE ALSO
287 .BR gethostbyname (3),
288 .BR resolver (3),
289 .BR hostname (7),
290 .BR named (8)
291 .br
292 Name Server Operations Guide for BIND