forward.5: use .Ar instead of .Aq for email address
[dragonfly.git] / share / man / man5 / resolver.5
1 .\" Copyright (c) 1986, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)resolver.5  8.1 (Berkeley) 6/5/93
29 .\" $FreeBSD: src/share/man/man5/resolver.5,v 1.7.2.1 2001/08/17 13:08:47 ru Exp $
30 .\" $DragonFly: src/share/man/man5/resolver.5,v 1.4 2008/05/02 02:05:06 swildner Exp $
31 .\"
32 .Dd November 11, 1993
33 .Dt RESOLVER 5
34 .Os
35 .Sh NAME
36 .Nm resolver
37 .Nd resolver configuration file
38 .Sh SYNOPSIS
39 .Nm resolv.conf
40 .Sh DESCRIPTION
41 The
42 .Xr resolver 3
43 is a set of routines in the C library
44 which provide access to the Internet Domain Name System.
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.
49 .Pp
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.
54 .Pp
55 The different configuration options are:
56 .Bl -tag -width nameserver
57 .It Sy nameserver
58 Internet address (in dot notation) of a name server
59 that the resolver should query.
60 Up to
61 .Dv MAXNS
62 (currently 3) name servers may be listed,
63 one per keyword.
64 If there are multiple servers,
65 the resolver library queries them in the order listed.
66 If no
67 .Sy nameserver
68 entries are present,
69 the default is to use the name server on the local machine.
70 (The algorithm used is to try a name server, and if the query times out,
71 try the next, until out of name servers,
72 then repeat trying all the name servers
73 until a maximum number of retries are made).
74 .It Sy domain
75 Local domain name.
76 Most queries for names within this domain can use short names
77 relative to the local domain.
78 If no
79 .Sy domain
80 entry is present, the domain is determined
81 from the local host name returned by
82 .Xr gethostname 3 ;
83 the domain part is taken to be everything after the first `.'.
84 Finally, if the host name does not contain a domain part, the root
85 domain is assumed.
86 .It Sy search
87 Search list for host-name lookup.
88 The search list is normally determined from the local domain name;
89 by default, it contains only the local domain name.
90 This may be changed by listing the desired domain search path
91 following the
92 .Sy search
93 keyword with spaces or tabs separating
94 the names.
95 Most resolver queries will be attempted using each component
96 of the search path in turn until a match is found.
97 Note that this process may be slow and will generate a lot of network
98 traffic if the servers for the listed domains are not local,
99 and that queries will time out if no server is available
100 for one of the domains.
101 .Pp
102 The search list is currently limited to six domains
103 with a total of 256 characters.
104 .It Sy sortlist
105 Sortlist allows addresses returned by gethostbyname to be sorted.
106 A sortlist is specified by IP address netmask pairs.
107 The netmask is
108 optional and defaults to the natural netmask of the net.
109 The IP address
110 and optional network pairs are separated by slashes.
111 Up to 10 pairs may
112 be specified.
113 .Pp
114 e.g. sortlist 130.155.160.0/255.255.240.0 130.155.0.0
115 .It Sy options
116 Options allows certain internal resolver variables to be modified.
117 The syntax is
118 .Pp
119 \fBoptions\fP \fIoption\fP \fI...\fP
120 .Pp
121 where
122 .Sy option
123 is one of the following:
124 .Bl -tag -width no_tld_query
125 .It Sy debug
126 sets
127 .Dv RES_DEBUG
128 in _res.options.
129 .It Sy ndots:n
130 sets a threshold for the number of dots which must appear in a name given to
131 .Fn res_query
132 (see
133 .Xr resolver 3 )
134 before an
135 .Em initial absolute query
136 will be made.
137 The default for
138 .Em n
139 is
140 .Dq 1 ,
141 meaning that if there are any dots in a name, the name
142 will be tried first as an absolute name before any
143 .Em search list
144 elements are appended to it.
145 .It Sy no_tld_query
146 tells the resolver not to attempt to resolve a top level domain name, that
147 is, a name that contains no dots.  Use of this option doesn't prevent
148 the resolver from obeying the standard
149 .Sy domain
150 and
151 .Sy search
152 rules with the given name.
153 .El
154 .Pp
155 Options may also be specified as a space or tab separated list using the
156 .Ev RES_OPTIONS
157 environment variable.
158 .El
159 .Pp
160 The
161 .Sy domain
162 and
163 .Sy search
164 keywords are mutually exclusive.
165 If more than one instance of these keywords is present,
166 the last instance will override.
167 .Pp
168 The keyword and value must appear on a single line, and the keyword
169 (e.g.\&
170 .Sy nameserver )
171 must start the line.  The value follows
172 the keyword, separated by white space.
173 .Sh FILES
174 .Bl -tag -width /etc/resolv.conf -compact
175 .It Pa /etc/resolv.conf
176 The file
177 .Nm resolv.conf
178 resides in
179 .Pa /etc .
180 .El
181 .Sh SEE ALSO
182 .Xr gethostbyname 3 ,
183 .Xr resolver 3 ,
184 .Xr hostname 7 ,
185 .Xr named 8
186 .Rs
187 .%T "Name Server Operations Guide for BIND"
188 .Re
189 .Sh HISTORY
190 The
191 .Nm resolv.conf
192 file format appeared in
193 .Bx 4.3 .