]> git.saurik.com Git - apple/libresolv.git/blob - resolver.5
libresolv-38.tar.gz
[apple/libresolv.git] / resolver.5
1 .\" $OpenBSD: resolver.5,v 1.2 1997/03/12 10:42:19 downsj Exp $
2 .\" Copyright (c) 1986 The Regents of the University of California.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms are permitted
6 .\" provided that the above copyright notice and this paragraph are
7 .\" duplicated in all such forms and that any documentation,
8 .\" advertising materials, and other materials related to such
9 .\" distribution and use acknowledge that the software was developed
10 .\" by the University of California, Berkeley. The name of the
11 .\" University may not be used to endorse or promote products derived
12 .\" from this software without specific prior written permission.
13 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 .\"
17 .\" Portions Copyright (c) 2003 by Apple Computer, Inc.
18 .\"
19 .\" @(#)resolver.5 5.9 (Berkeley) 12/14/89
20 .\" $From: resolver.5,v 8.3 1995/12/06 20:34:35 vixie Exp $
21 .\"
22 .Dd June 6, 2003
23 .Dt resolver 5
24 .Os "Mac OS X"
25 .Sh NAME
26 .Nm resolver
27 .Nd resolver configuration file format
28 .Sh DESCRIPTION
29 The
30 .Nm
31 is a set of routines in the C library
32 .Xr resolv(3)
33 that provide access to the Internet Domain Name System (DNS).
34 A resolver configuration file contains information used to specify parameters
35 for a DNS resolver client.
36 The file contains a list of keywords with values that provide various types
37 of resolver information.
38 .Pp
39 Mac OS X supports a DNS search strategy that may involve multiple
40 DNS resolver clients.
41 See the
42 .Sx SEARCH STRATEGY
43 section below for an overview of multi-client DNS
44 search.
45 .Pp
46 Each DNS client is configured using the contents of a single configuration
47 file of the format described below, or from a property list supplied from
48 some other system configuration database.
49 Note that the
50 .Pa /etc/resolv.conf
51 file, which contains configuration for the default (or "primary") DNS resolver client,
52 is maintained automatically by Mac OS X and should not be edited manually.
53 Changes to the DNS configuration should be made by using the Network
54 Preferences panel.
55 .Pp
56 The different configuration options are given below.
57 .Ss nameserver
58 Internet address (in dot notation for IPv4 or in colon notation for IPv6)
59 of a name server that the resolver should query.
60 The address may optionally have a trailing dot followed by a port number.
61 For example,
62 .Li 10.0.0.17.55
63 specifies that the nameserver at 10.0.0.17
64 uses port 55.
65 .Pp
66 Up to
67 .Va MAXNS
68 (currently 3) name servers may be listed,
69 one per keyword.
70 If there are multiple servers,
71 the resolver library queries them in the order listed.
72 The algorithm used is to try a name server, and if the query times out,
73 try the next, until out of name servers,
74 then repeat trying all the name servers
75 until a maximum number of retries are made.
76 .Ss port
77 IP port number to be used for this resolver.
78 The default port is 53.
79 The port number for an individual nameserver may be specified as
80 part of the nameserver address (see
81 .Sx nameserver
82 above) to override the default
83 or the port number specified as a value for this keyword.
84 .Ss domain
85 Domain name associated with this resolver configuration.
86 This option is normally not required by the Mac OS X DNS search system
87 when the resolver configuration is read from a file in the
88 .Pa /etc/resolver
89 directory.
90 In that case the file name is used as the domain name.
91 However,
92 .Sx domain
93 must be provided when there are
94 multiple resolver clients for the same domain name, since multiple
95 files may not exist having the same name.
96 See the
97 .Sx SEARCH STRATEGY
98 section for more details.
99 .Ss search
100 Search list for host-name lookup.
101 This parameter is only used by the "Super" DNS resolver, which
102 manages the DNS search strategy amongst multiple DNS resolver clients.
103 Unqualified queries will be attempted using each component
104 of the search list in turn until a match is found.
105 Note that this process may be slow and will generate a lot of network
106 traffic if the servers for the listed domains are not local,
107 and that queries will time out if no server is available
108 for one of the domains.
109 .Pp
110 The search list is currently limited to six domains
111 with a total of 256 characters.
112 .Ss search_order
113 Only required for those clients that share a domain name with other clients.
114 Queries will be sent to these clients in order by ascending
115 .Sx search_order
116 value.
117 For example, this allows two clients for the ".local"
118 domain, which is used by Apple's multicast DNS, but which may
119 also be used at some sites as private DNS domain name.
120 .Ss sortlist
121 Sortlist allows addresses returned by gethostbyname to be sorted.
122 A sortlist is specified by IP address netmask pairs. The netmask is
123 optional and defaults to the natural netmask of the net. The IP address
124 and optional network pairs are separated by slashes. Up to 10 pairs may
125 be specified. For example:
126 .Bd -literal -offset indent
127 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
128 .Ed
129 .Ss timeout
130 Specifies the total amount of time allowed for a name resolution.
131 This time interval is divided by the number of nameservers and the number
132 of retries allowed for each nameserver.
133 .Ss options
134 Options allows certain internal resolver variables to be modified.
135 The syntax is:
136 .Pp
137 options
138 .Ar option Li "..."
139 .Pp
140 where
141 .Ar option
142 is one of the following:
143 .Bl -tag -width -indent
144 .It Ar debug
145 sets
146 .Va RES_DEBUG
147 in the resolver options.
148 .It Ar timeout:n
149 sets the per-retry timeout for resolver queries.
150 The total timeout allowed for a query depends on the number of retries and the
151 number of nameservers. This value is ignored if a total timeout is specified
152 using the
153 .Sx timeout
154 keyword (see above).
155 .It Ar ndots:n
156 Sets a threshold for the number of dots which
157 must appear in a name given to
158 .Sx res_query
159 (see
160 .Xr resolver(3))
161 before an initial absolute query will be made. The default for
162 .Ar n
163 is ``1'', meaning that if there are any dots in a name, the name
164 will be tried first as an absolute name before any
165 .Sx search
166 list elements are appended to it.
167 .Pp
168 The keyword and value must appear on a single line,
169 and the keyword must start the line.
170 The value follows the keyword, separated by white space.
171 .El
172 .Sh SEARCH STRATEGY
173 Mac OS X uses a DNS search strategy that supports multiple DNS
174 client configurations.
175 Each DNS client has its own set of nameserver
176 addresses and its own set of operational parameters.
177 Each client can perform DNS queries and searches independent of other clients.
178 Each client has a symbolic name which is of the same format as a
179 domain name, e.g. "apple.com".
180 A special meta-client, known as the
181 "Super" DNS client acts as a router for DNS queries.
182 The Super client chooses among all available clients by finding a best match
183 between the domain name given in a query and the names of all known clients.
184 .Pp
185 Queries for qualified names
186 are sent using a client configuration
187 that best matches the domain name given in the query.
188 For example, if there is a client named "apple.com", a search for
189 "www.apple.com" would use the resolver configuration specified for that client.
190 The matching algorithm chooses the client with the maximum number of matching
191 domain components.
192 For example, if there are clients named "a.b.c", and "b.c", a search for
193 "x.a.b.c" would use the "a.b.c" resolver configuration, while a search
194 for "x.y.b.c" would use the "b.c" client.
195 If there are no matches, the configuration settings in the default client,
196 generally corresponding to the
197 .Pa /etc/resolv.conf
198 file or to the "primary" DNS
199 configuration on the system are used for the query.
200 .Pp
201 If multiple clients are available for the same domain name, the clients ordered
202 according to a
203 .Sx search_order
204 value (see above).
205 Queries are sent to these resolvers in sequence by ascending value of
206 search_order.
207 .Pp
208 The configuration for a particular client may be read from a file
209 having the format described in this man page.
210 These are at present located by the system in the
211 .Pa /etc/resolv.conf
212 file and
213 in the files found in the
214 .Pa /etc/resolver
215 directory.
216 However, client configurations are not limited to file storage.
217 The implementation of the DNS multi-client search strategy may also locate
218 client configuratins in other data sources, such as the System Configuration
219 Database.
220 Users of the DNS system should make no assumptions about the
221 source of the configuration data.
222 .Sh FILES
223 /etc/resolv.conf, /etc/resolver/*
224 .Sh SEE ALSO
225 gethostbyname(2), getaddrinfo(3), resolver(3)