1 .\" Copyright (c) 1986 The Regents of the University of California.
2 .\" All rights reserved.
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.
16 .\" @(#)resolver.5 5.9 (Berkeley) 12/14/89
17 .\" $Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $
19 .\" Added ndots remark by Bernhard R. Link - debian bug #182886
21 .TH RESOLV.CONF 5 2004-10-31 "" "Linux Programmer's Manual"
24 resolv.conf \- resolver configuration file
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.
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.
42 The different configuration options are:
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,
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.)
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
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
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
74 Resolver queries having fewer than
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
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.
98 The search list is currently limited to six domains
99 with a total of 256 characters.
102 Sortlist allows addresses returned by
103 .BR gethostbyname (3)
105 A sortlist is specified by IP address netmask pairs.
107 optional and defaults to the natural netmask of the net.
109 and optional network pairs are separated by slashes.
115 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
120 Options allows certain internal resolver variables to be modified.
124 \fBoptions\fP \fIoption\fP \fI...\fP
126 where \fIoption\fP is one of the following:
133 sets a threshold for the number of dots which
134 must appear in a name given to
138 before an \fIinitial absolute query\fP will be made.
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.
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.
149 the default is RES_TIMEOUT (currently 5, see <resolv.h>).
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>).
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.
165 sets RES_NOCHECKNAME in
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.
172 sets RES_USE_INET6 in
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.
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.
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.
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.
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.
197 .IR /etc/resolv.conf ,
200 .BR gethostbyname (3),
205 Name Server Operations Guide for BIND