1 .\" $NetBSD: resolv.conf.5,v 1.30 2012/09/09 18:09:24 christos Exp $
3 .\" Copyright (c) 1986, 1991 The Regents of the University of California.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)resolver.5 5.12 (Berkeley) 5/10/91
37 .Nd resolver configuration file
41 file specifies how the
43 routines in the C library
44 (which provide access to the Internet Domain Name System) should operate.
45 The resolver configuration file contains information that is read
46 by the resolver routines the first time they are invoked by a process.
47 The file is designed to be human readable and contains a list of
48 keywords with values that provide various types of resolver information.
50 On a normally configured system this file should not be necessary.
51 The only name server to be queried will be on the local machine,
52 the domain name is determined from the host name,
53 and the domain search path is constructed from the domain name.
55 The different configuration options are:
56 .Bl -tag -width nameserver
61 .Pq in hex-and-colon notation
62 of a name server that the resolver should query.
63 Scoped IPv6 address notation is accepted as well
71 (currently 3) name servers may be listed,
73 If there are multiple servers,
74 the resolver library queries them in the order listed.
78 the default is to use the name server on the local machine.
79 (The algorithm used is to try a name server, and if the query times out,
80 try the next, until out of name servers,
81 then repeat trying all the name servers
82 until a maximum number of retries are made).
85 Most queries for names within this domain can use short names
86 relative to the local domain.
89 entry is present, the domain is determined
90 from the local host name returned by
92 the domain part is taken to be everything after the first
94 Finally, if the host name does not contain a domain part, the root
97 This keyword is now ignored: its function has been superseded by
102 Search list for host-name lookup.
103 The search list is normally determined from the local domain name;
104 by default, it begins with the local domain name, then successive
105 parent domains that have at least two components in their names.
106 This may be changed by listing the desired domain search path
109 keyword with spaces or tabs separating
111 Most resolver queries will be attempted using each component
112 of the search path in turn until a match is found.
113 Note that this process may be slow and will generate a lot of network
114 traffic if the servers for the listed domains are not local,
115 and that queries will time out if no server is available
116 for one of the domains.
118 The search list is currently limited to six domains
119 with a total of 1024 characters.
121 Sortlist allows addresses returned by gethostbyname to
123 A sortlist is specified by IP address netmask pairs.
124 The netmask is optional and defaults to the natural
126 The IP address and optional network pairs are separated by
128 Up to 10 pairs may be specified, ie.
130 .Sy sortlist 130.155.160.0/255.255.240.0 130.155.0.0
132 Options allows certain internal resolver variables to be modified.
135 .Sy options option ...
137 where option is one of the following:
138 .Bl -tag -width no-check-names
140 enable debugging information, by setting RES_DEBUG in _res.options
144 sets a threshold for the number of dots which
145 must appear in a name given to res_query (see
147 before an initial absolute query will be made.
148 The default for n is 1, meaning that if there are any
149 dots in a name, the name will be tried first as an absolute
150 name before any search list elements are appended to it.
152 sets the amount of time the resolver will wait for a response from a remote
153 name server before retrying the query via a different name server.
154 Measured in seconds, the default is
159 sets the number of times the resolver will send a query to its name servers
160 before giving up and returning an error to the calling application.
170 which causes round robin selection of nameservers from among those listed.
171 This has the effect of spreading the query load among all listed servers,
172 rather than having all clients try the first listed server first every time.
173 .It Sy no-check-names
178 which disables the modern BIND checking of incoming host names and mail names
179 for invalid characters such as underscore
181 non-ASCII, or control characters.
188 which enables the modern BIND checking of incoming host names and mail names
191 attach OPT pseudo-RR for ENDS0 extension specified in RFC 2671,
192 to inform DNS server of our receive buffer size.
193 The option will allow DNS servers to take advantage of non-default receive
194 buffer size, and to send larger replies.
195 DNS query packets with EDNS0 extension is not compatible with
196 non-EDNS0 DNS servers.
197 The option must be used only when all the DNS servers listed in
199 lines are able to handle EDNS0 extension.
201 enable support for IPv6-only applications, by setting RES_USE_INET6 in
204 The option is meaningful with certain kernel configuration only and
205 use of this option is discouraged.
207 Do not require IP source address on the reply packet to be equal to the
210 Do not check if the query section of the reply packet is equal
211 to that of the query packet.
212 For testing purposes only.
220 to not attempt to resolve a unqualified name as if it were a top level
222 This option can cause problems if the site has
225 than having localhost on one or more elements of the search list.
226 This option has no effect if neither
238 keywords are mutually exclusive.
239 If more than one instance of these keywords is present,
240 the last instance will override.
244 keyword of a system's
246 file can be overridden on a per-process basis by setting the
249 to a space-separated list of search domains.
253 keyword of a system's
255 file can be amended on a per-process basis by setting the
258 to a space-separated list of resolver options as explained above.
260 The keyword and value must appear on a single line, and the keyword
264 The value follows the keyword, separated by white space.
266 .Bl -tag -width /etc/resolv.conf -compact
267 .It Pa /etc/resolv.conf
274 .Xr gethostbyname 3 ,
276 .Xr nsswitch.conf 5 ,
283 .%A Michael J. Karels
284 .%T "Name Server Operations Guide for BIND"
287 .%I Department of Electrical Engineering and Computer Sciences ,
288 .%I University of California, Berkeley
290 .%U http://www.dns.net/dnsrd/docs/bog/bog.html
295 file format appeared in