mdoc version three
[unix-history] / usr / src / share / man / man5 / resolver.5
CommitLineData
eadcc84a 1.\" Copyright (c) 1986, 1991 The Regents of the University of California.
d58c18e3 2.\" All rights reserved.
ba305536 3.\"
eadcc84a 4.\" %sccs.include.redist.roff%
d58c18e3 5.\"
eadcc84a 6.\" @(#)resolver.5 5.12 (Berkeley) %G%
56b0d82b 7.\"
eadcc84a
CL
8.Dd
9.Dt RESOLVER 5
10.Os BSD 4
11.Sh NAME
12.Nm resolver
13.Nd resolver configuration file
14.Sh SYNOPSIS
15.Nm resolv.conf
16.Sh DESCRIPTION
e91b6c79 17The
eadcc84a
CL
18.Xr resolver 3
19is a set of routines in the C library
20which provide access to the Internet Domain Name System.
ba305536 21The resolver configuration file contains information that is read
56b0d82b 22by the resolver routines the first time they are invoked by a process.
ba305536 23The file is designed to be human readable and contains a list of
e91b6c79 24keywords with values that provide various types of resolver information.
eadcc84a 25.Pp
56b0d82b 26On a normally configured system this file should not be necessary.
e91b6c79
MK
27The only name server to be queried will be on the local machine,
28the domain name is determined from the host name,
29and the domain search path is constructed from the domain name.
eadcc84a 30.Pp
ba305536 31The different configuration options are:
eadcc84a
CL
32.Bl -tag -width nameserver
33.It Sy nameserver
e91b6c79
MK
34Internet address (in dot notation) of a name server
35that the resolver should query.
eadcc84a
CL
36Up to
37.Dv MAXNS
38(currently 3) name servers may be listed,
e91b6c79
MK
39one per keyword.
40If there are multiple servers,
41the resolver library queries them in the order listed.
eadcc84a
CL
42If no
43.Sy nameserver
44entries are present,
56b0d82b 45the default is to use the name server on the local machine.
e925f881 46(The algorithm used is to try a name server, and if the query times out,
56b0d82b
JB
47try the next, until out of name servers,
48then repeat trying all the name servers
e925f881 49until a maximum number of retries are made).
eadcc84a 50.It Sy domain
e91b6c79
MK
51Local domain name.
52Most queries for names within this domain can use short names
53relative to the local domain.
eadcc84a
CL
54If no
55.Sy domain
56entry is present, the domain is determined
e91b6c79 57from the local host name returned by
eadcc84a 58.Xr gethostname 2 ;
e91b6c79 59the domain part is taken to be everything after the first `.'.
56b0d82b
JB
60Finally, if the host name does not contain a domain part, the root
61domain is assumed.
eadcc84a 62.It Sy search
e91b6c79
MK
63Search list for host-name lookup.
64The search list is normally determined from the local domain name;
65by default, it begins with the local domain name, then successive
66parent domains that have at least two components in their names.
67This may be changed by listing the desired domain search path
eadcc84a
CL
68following the
69.Sy search
70keyword with spaces or tabs separating
e91b6c79
MK
71the names.
72Most resolver queries will be attempted using each component
73of the search path in turn until a match is found.
74Note that this process may be slow and will generate a lot of network
75traffic if the servers for the listed domains are not local,
76and that queries will time out if no server is available
77for one of the domains.
eadcc84a 78.Pp
bddb61e0
MK
79The search list is currently limited to six domains
80with a total of 256 characters.
eadcc84a
CL
81.El
82.Pp
83The
84.Sy domain
85and
86.Sy search
87keywords are mutually exclusive.
e91b6c79
MK
88If more than one instance of these keywords is present,
89the last instance will override.
eadcc84a 90.Pp
e91b6c79 91The keyword and value must appear on a single line, and the keyword
eadcc84a
CL
92(e.g.
93.Sy nameserver )
94must start the line. The value follows
e925f881 95the keyword, separated by white space.
eadcc84a
CL
96.Sh FILES
97.Bl -tag -width /etc/resolv.conf -compact
98.It Pa /etc/resolv.conf
99The file
100.Nm resolv.conf
101resides in
102.Pa /etc .
103.El
104.Sh SEE ALSO
105.Xr gethostbyname 3 ,
106.Xr resolver 3 ,
107.Xr hostname 7 ,
108.Xr named 8
109.Rs
110.%T "Name Server Operations Guide for BIND"
111.Re
112.Sh HISTORY
113The
114.Nm resolv.conf
115file format appeared in
116.Bx 4.3 .