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