]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man5/resolv.conf.5
Change "e.g. " to "e.g., ", or in some cases, "for example, ".
[thirdparty/man-pages.git] / 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 2004-10-31 "" "Linux Programmer's Manual"
22 .UC 4
23 .SH NAME
24 resolv.conf \- resolver configuration file
25 .SH SYNOPSIS
26 /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 host name
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 MAXNS (currently 3, see <resolv.h>) name servers may be listed,
48 one per keyword.
49 If there are multiple servers,
50 the resolver library queries them in the order listed.
51 If no \fBnameserver\fP entries are present,
52 the default is to use the name server on the local machine.
53 (The algorithm used is to try a name server, and if the query times out,
54 try the next, until out of name servers,
55 then repeat trying all the name servers
56 until a maximum number of retries are made.)
57 .TP
58 \fBdomain\fP Local domain name.
59 Most queries for names within this domain can use short names
60 relative to the local domain.
61 If no \fBdomain\fP entry is present, the domain is determined
62 from the local host name returned by
63 .BR gethostname (2);
64 the domain part is taken to be everything after the first `.'.
65 Finally, if the host name does not contain a domain part, the root
66 domain is assumed.
67 .TP
68 \fBsearch\fP Search list for host-name lookup.
69 The search list is normally determined from the local domain name;
70 by default, it contains only the local domain name.
71 This may be changed by listing the desired domain search path
72 following the \fIsearch\fP keyword with spaces or tabs separating
73 the names.
74 Resolver queries having fewer than
75 .I ndots
76 dots (default is 1) in them will be attempted using each component
77 of the search path in turn until a match is found.
78 For environments with multiple subdomains please read
79 .BI "options ndots:" n
80 below to avoid man-in-the-middle attacks and unnecessary
81 traffic for the root-dns-servers.
82 .\" When having a resolv.conv with a line
83 .\" search subdomain.domain.tld domain.tld
84 .\" and doing a hostlookup, for example by
85 .\" ping host.anothersubdomain
86 .\" it sends dns-requests for
87 .\" host.anothersubdomain.
88 .\" host.anothersubdomain.subdomain.domain.tld.
89 .\" host.anothersubdomain.domain.tld.
90 .\" thus not only causing unnecessary traffic for the root-dns-servers
91 .\" but broadcasting information to the outside and making man-in-the-middle
92 .\" attacks possible.
93 Note that this process may be slow and will generate a lot of network
94 traffic if the servers for the listed domains are not local,
95 and that queries will time out if no server is available
96 for one of the domains.
97 .IP
98 The search list is currently limited to six domains
99 with a total of 256 characters.
100 .TP
101 \fBsortlist\fP
102 Sortlist allows addresses returned by
103 .BR gethostbyname (3)
104 to be sorted.
105 A sortlist is specified by IP address netmask pairs.
106 The netmask is
107 optional and defaults to the natural netmask of the net.
108 The IP address
109 and optional network pairs are separated by slashes.
110 Up to 10 pairs may
111 be specified.
112 E.g.,
113 .br
114 .in +2
115 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
116 .in -2
117 .br
118 .TP
119 \fBoptions\fP
120 Options allows certain internal resolver variables to be modified.
121 The syntax is
122 .RS
123 .IP
124 \fBoptions\fP \fIoption\fP \fI...\fP
125 .LP
126 where \fIoption\fP is one of the following:
127 .TP
128 \fBdebug\fP
129 sets RES_DEBUG in
130 .IR _res.options .
131 .TP
132 .BI ndots: n
133 sets a threshold for the number of dots which
134 must appear in a name given to
135 .BR res_query (3)
136 (see
137 .BR resolver (3))
138 before an \fIinitial absolute query\fP will be made.
139 The default for
140 \fIn\fP is ``1'', meaning that if there are any dots in a name, the name
141 will be tried first as an absolute name before any \fIsearch list\fP
142 elements are appended to it.
143 .TP
144 .BI timeout: n
145 sets the amount of time the resolver will wait for a
146 response from a remote name server before retrying the
147 query via a different name server.
148 Measured in seconds,
149 the default is RES_TIMEOUT (currently 5, see <resolv.h>).
150 .TP
151 .BI attempts: n
152 sets the number of times the resolver will send a
153 query to its name servers before giving up and returning
154 an error to the calling application.
155 The default is RES_DFLRETRY (currently 2, see <resolv.h>).
156 .TP
157 .B rotate
158 sets RES_ROTATE in
159 .IR _res.options ,
160 which causes round robin selection of nameservers from among those listed.
161 This has the effect of spreading the query load among all listed servers,
162 rather than having all clients try the first listed server first every time.
163 .TP
164 .B no-check-names
165 sets RES_NOCHECKNAME in
166 .IR _res.options ,
167 which disables the modern BIND checking of incoming host names and
168 mail names for invalid characters such as underscore (_), non-ASCII,
169 or control characters.
170 .TP
171 .B inet6
172 sets RES_USE_INET6 in
173 .IR _res.options .
174 This has the effect of trying a AAAA query before an A query inside the
175 .BR gethostbyname (3)
176 function, and of mapping IPv4 responses in IPv6 ``tunneled form''
177 if no AAAA records are found but an A record set exists.
178 .RE
179 .LP
180 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
181 If more than one instance of these keywords is present,
182 the last instance wins.
183 .LP
184 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
185 overridden on a per-process basis by setting the environment variable
186 ``\s-1LOCALDOMAIN\s+1'' to a space-separated list of search domains.
187 .LP
188 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
189 amended on a per-process basis by setting the environment variable
190 ``\s-1RES_OPTIONS\s+1'' to a space-separated list of resolver options
191 as explained above under \fBoptions\fP.
192 .LP
193 The keyword and value must appear on a single line, and the keyword
194 (e.g., \fBnameserver\fP) must start the line.
195 The value follows the keyword, separated by white space.
196 .SH FILES
197 .IR /etc/resolv.conf ,
198 .I <resolv.h>
199 .SH "SEE ALSO"
200 .BR gethostbyname (3),
201 .BR resolver (3),
202 .BR hostname (7),
203 .BR named (8)
204 .br
205 Name Server Operations Guide for BIND