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