OSDN Git Service

(split) LDP: Update original to v3.37.
[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 .\" 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.
15 .\"
16 .\"     @(#)resolver.5  5.9 (Berkeley) 12/14/89
17 .\"     $Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $
18 .\"
19 .\" Added ndots remark by Bernhard R. Link - debian bug #182886
20 .\"
21 .TH RESOLV.CONF 5 2012-02-08 "" "Linux Programmer's Manual"
22 .UC 4
23 .SH NAME
24 resolv.conf \- resolver configuration file
25 .SH SYNOPSIS
26 .B /etc/resolv.conf
27 .SH DESCRIPTION
28 The
29 .I resolver
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.
36 .LP
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.
41 .LP
42 The different configuration options are:
43 .TP
44 \fBnameserver\fP Name server IP address
45 Internet address (in dot notation) of a name server
46 that the resolver should query.
47 Up to
48 .B MAXNS
49 (currently 3, see \fI<resolv.h>\fP) name servers may be listed,
50 one per keyword.
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.)
59 .TP
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
65 .BR gethostname (2);
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
68 domain is assumed.
69 .TP
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
75 the names.
76 Resolver queries having fewer than
77 .I ndots
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
94 .\" attacks possible.
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.
99 .IP
100 The search list is currently limited to six domains
101 with a total of 256 characters.
102 .TP
103 \fBsortlist\fP
104 This option allows addresses returned by
105 .BR gethostbyname (3)
106 to be sorted.
107 A sortlist is specified by IP-address-netmask pairs.
108 The netmask is
109 optional and defaults to the natural netmask of the net.
110 The IP address
111 and optional network pairs are separated by slashes.
112 Up to 10 pairs may
113 be specified.
114 Here is an example:
115
116 .in +4n
117 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
118 .in
119 .br
120 .TP
121 \fBoptions\fP
122 Options allows certain internal resolver variables to be modified.
123 The syntax is
124 .RS
125 .IP
126 \fBoptions\fP \fIoption\fP \fI...\fP
127 .LP
128 where \fIoption\fP is one of the following:
129 .TP
130 \fBdebug\fP
131 .\" Since glibc 2.2?
132 sets
133 .BR RES_DEBUG
134 in
135 .IR _res.options .
136 .TP
137 .BI ndots: n
138 .\" Since glibc 2.2
139 sets a threshold for the number of dots which
140 must appear in a name given to
141 .BR res_query (3)
142 (see
143 .BR resolver (3))
144 before an \fIinitial absolute query\fP will be made.
145 The default for
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.
150 .TP
151 .BI timeout: n
152 .\" Since glibc 2.2
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.
156 Measured in seconds,
157 the default is
158 .BR RES_TIMEOUT
159 (currently 5, see \fI<resolv.h>\fP).
160 The value for this option is silently capped to 30.
161 .TP
162 .BI attempts: n
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.
166 The default is
167 .BR RES_DFLRETRY
168 (currently 2, see \fI<resolv.h>\fP).
169 The value for this option is silently capped to 5.
170 .TP
171 .B rotate
172 .\" Since glibc 2.2
173 sets
174 .BR RES_ROTATE
175 in
176 .IR _res.options ,
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.
180 .TP
181 .B no-check-names
182 .\" since glibc 2.2
183 sets
184 .BR RES_NOCHECKNAME
185 in
186 .IR _res.options ,
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.
190 .TP
191 .B inet6
192 .\" Since glibc 2.2
193 sets
194 .BR RES_USE_INET6
195 in
196 .IR _res.options .
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.
201 .TP
202 .BR ip6-bytestring " (since glibc 2.3.4)"
203 sets
204 .BR RES_USE_BSTRING
205 in
206 .IR _res.options .
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.
210 .TP
211 .BR ip6-dotint / no-ip6-dotint " (since glibc 2.3.4)"
212 Clear/set
213 .BR RES_NOIP6DOTINT
214 in
215 .IR _res.options .
216 When this option is clear
217 .RB ( ip6-dotint ),
218 reverse IPv6 lookups are made in the (deprecated)
219 .I ip6.int
220 zone;
221 when this option is set
222 .RB ( no-ip6-dotint ),
223 reverse IPv6 lookups are made in the
224 .I ip6.arpa
225 zone by default.
226 This option is set by default.
227 .TP
228 .BR edns0 " (since glibc 2.6)"
229 sets
230 .BR RES_USE_EDNSO
231 in
232 .IR _res.options .
233 This enables support for the DNS extensions described in RFC\ 2671.
234 .RE
235 .LP
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.
239 .LP
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
242 .B LOCALDOMAIN
243 to a space-separated list of search domains.
244 .LP
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
247 .B RES_OPTIONS
248 to a space-separated list of resolver options
249 as explained above under \fBoptions\fP.
250 .LP
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.
254
255 Lines that contain a semicolon (;) or hash character (#)
256 in the first column are treated as comments.
257 .SH FILES
258 .IR /etc/resolv.conf ,
259 .I <resolv.h>
260 .SH "SEE ALSO"
261 .BR gethostbyname (3),
262 .BR resolver (3),
263 .BR hostname (7),
264 .BR named (8)
265 .br
266 Name Server Operations Guide for BIND