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