]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man5/resolv.conf.5
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[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
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 \fIgethostname\fP();
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 gethostbyname to be sorted.
103 A sortlist is specified by IP address netmask pairs.
104 The netmask is
105 optional and defaults to the natural netmask of the net.
106 The IP address
107 and optional network pairs are separated by slashes.
108 Up to 10 pairs may
109 be specified.
110 E.g.,
111 .br
112 .in +2
113 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
114 .in -2
115 .br
116 .TP
117 \fBoptions\fP
118 Options allows certain internal resolver variables to be modified.
119 The syntax is
120 .RS
121 .IP
122 \fBoptions\fP \fIoption\fP \fI...\fP
123 .LP
124 where \fIoption\fP is one of the following:
125 .TP
126 \fBdebug\fP
127 sets RES_DEBUG in
128 .IR _res.options .
129 .TP
130 .BI ndots: n
131 sets a threshold for the number of dots which
132 must appear in a name given to \fBres_query\fP() (see
133 .BR resolver (3))
134 before an \fIinitial absolute query\fP will be made.
135 The default for
136 \fIn\fP is ``1'', meaning that if there are any dots in a name, the name
137 will be tried first as an absolute name before any \fIsearch list\fP
138 elements are appended to it.
139 .TP
140 .BI timeout: n
141 sets the amount of time the resolver will wait for a
142 response from a remote name server before retrying the
143 query via a different name server.
144 Measured in seconds,
145 the default is RES_TIMEOUT (currently 5, see <resolv.h>).
146 .TP
147 .BI attempts: n
148 sets the number of times the resolver will send a
149 query to its name servers before giving up and returning
150 an error to the calling application.
151 The default is RES_DFLRETRY (currently 2, see <resolv.h>).
152 .TP
153 .B rotate
154 sets RES_ROTATE in
155 .IR _res.options ,
156 which causes round robin selection of nameservers from among those listed.
157 This has the effect of spreading the query load among all listed servers,
158 rather than having all clients try the first listed server first every time.
159 .TP
160 .B no-check-names
161 sets RES_NOCHECKNAME in
162 .IR _res.options ,
163 which disables the modern BIND checking of incoming host names and
164 mail names for invalid characters such as underscore (_), non-ASCII,
165 or control characters.
166 .TP
167 .B inet6
168 sets RES_USE_INET6 in
169 .IR _res.options .
170 This has the effect of trying a AAAA query before an A query inside the
171 .BR gethostbyname ()
172 function, and of mapping IPv4 responses in IPv6 ``tunnelled form''
173 if no AAAA records are found but an A record set exists.
174 .RE
175 .LP
176 The \fIdomain\fP and \fIsearch\fP keywords are mutually exclusive.
177 If more than one instance of these keywords is present,
178 the last instance wins.
179 .LP
180 The \fIsearch\fP keyword of a system's \fIresolv.conf\fP file can be
181 overridden on a per-process basis by setting the environment variable
182 ``\s-1LOCALDOMAIN\s+1'' to a space-separated list of search domains.
183 .LP
184 The \fIoptions\fP keyword of a system's \fIresolv.conf\fP file can be
185 amended on a per-process basis by setting the environment variable
186 ``\s-1RES_OPTIONS\s+1'' to a space-separated list of resolver options
187 as explained above under \fBoptions\fP.
188 .LP
189 The keyword and value must appear on a single line, and the keyword
190 (e.g. \fBnameserver\fP) must start the line.
191 The value follows the keyword, separated by white space.
192 .SH FILES
193 .IR /etc/resolv.conf ,
194 .I <resolv.h>
195 .SH "SEE ALSO"
196 .BR gethostbyname (3),
197 .BR resolver (3),
198 .BR hostname (7),
199 .BR named (8)
200 .br
201 Name Server Operations Guide for BIND