1RESOLV.CONF(5) File Formats Manual RESOLV.CONF(5)
2
3
4
6 resolv.conf - resolver configuration file
7
9 /etc/resolv.conf
10
12 The resolver is a set of routines in the C library that provide access
13 to the Internet Domain Name System (DNS). The resolver configuration
14 file contains information that is read by the resolver routines the
15 first time they are invoked by a process. The file is designed to be
16 human readable and contains a list of keywords with values that provide
17 various types of resolver information.
18
19 On a normally configured system this file should not be necessary. The
20 only name server to be queried will be on the local machine; the domain
21 name is determined from the host name and the domain search path is
22 constructed from the domain name.
23
24 The different configuration options are:
25
26 nameserver Name server IP address
27 Internet address (in dot notation) of a name server that the
28 resolver should query. Up to MAXNS (currently 3, see
29 <resolv.h>) name servers may be listed, one per keyword. If
30 there are multiple servers, the resolver library queries them in
31 the order listed. If no nameserver entries are present, the
32 default is to use the name server on the local machine. (The
33 algorithm used is to try a name server, and if the query times
34 out, try the next, until out of name servers, then repeat trying
35 all the name servers until a maximum number of retries are
36 made.)
37
38 domain Local domain name.
39 Most queries for names within this domain can use short names
40 relative to the local domain. If no domain entry is present,
41 the domain is determined from the local host name returned by
42 gethostname(); the domain part is taken to be everything after
43 the first `.'. Finally, if the host name does not contain a
44 domain part, the root domain is assumed.
45
46 search Search list for host-name lookup.
47 The search list is normally determined from the local domain
48 name; by default, it contains only the local domain name. This
49 may be changed by listing the desired domain search path follow‐
50 ing the search keyword with spaces or tabs separating the names.
51 Resolver queries having fewer than ndots dots (default is 1) in
52 them will be attempted using each component of the search path
53 in turn until a match is found. For environments with multiple
54 subdomains please read options ndots:n below to avoid man-in-
55 the-middle attacks and unnecessary traffic for the root-dns-
56 servers. Note that this process may be slow and will generate a
57 lot of network traffic if the servers for the listed domains are
58 not local, and that queries will time out if no server is avail‐
59 able for one of the domains.
60
61 The search list is currently limited to six domains with a total
62 of 256 characters.
63
64 sortlist
65 Sortlist allows addresses returned by gethostbyname to be
66 sorted. A sortlist is specified by IP address netmask pairs.
67 The netmask is optional and defaults to the natural netmask of
68 the net. The IP address and optional network pairs are separated
69 by slashes. Up to 10 pairs may be specified. E.g.,
70 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
71
72 options
73 Options allows certain internal resolver variables to be modi‐
74 fied. The syntax is
75
76 options option ...
77
78 where option is one of the following:
79
80 debug sets RES_DEBUG in _res.options.
81
82 ndots:n
83 sets a threshold for the number of dots which must appear
84 in a name given to res_query() (see resolver(3)) before
85 an initial absolute query will be made. The default for
86 n is ``1'', meaning that if there are any dots in a name,
87 the name will be tried first as an absolute name before
88 any search list elements are appended to it.
89
90 timeout:n
91 sets the amount of time the resolver will wait for a
92 response from a remote name server before retrying the
93 query via a different name server. Measured in seconds,
94 the default is RES_TIMEOUT (currently 5, see <resolv.h>).
95
96 attempts:n
97 sets the number of times the resolver will send a query
98 to its name servers before giving up and returning an
99 error to the calling application. The default is
100 RES_DFLRETRY (currently 2, see <resolv.h>).
101
102 rotate sets RES_ROTATE in _res.options, which causes round robin
103 selection of nameservers from among those listed. This
104 has the effect of spreading the query load among all
105 listed servers, rather than having all clients try the
106 first listed server first every time.
107
108 no-check-names
109 sets RES_NOCHECKNAME in _res.options, which disables the
110 modern BIND checking of incoming host names and mail
111 names for invalid characters such as underscore (_), non-
112 ASCII, or control characters.
113
114 inet6 sets RES_USE_INET6 in _res.options. This has the effect
115 of trying a AAAA query before an A query inside the geth‐
116 ostbyname() function, and of mapping IPv4 responses in
117 IPv6 ``tunnelled form'' if no AAAA records are found but
118 an A record set exists.
119
120 The domain and search keywords are mutually exclusive. If more than
121 one instance of these keywords is present, the last instance wins.
122
123 The search keyword of a system's resolv.conf file can be overridden on
124 a per-process basis by setting the environment variable ``LOCALDOMAIN''
125 to a space-separated list of search domains.
126
127 The options keyword of a system's resolv.conf file can be amended on a
128 per-process basis by setting the environment variable ``RES_OPTIONS''
129 to a space-separated list of resolver options as explained above under
130 options.
131
132 The keyword and value must appear on a single line, and the keyword
133 (e.g. nameserver) must start the line. The value follows the keyword,
134 separated by white space.
135
137 /etc/resolv.conf, <resolv.h>
138
140 gethostbyname(3), resolver(3), hostname(7), named(8)
141 Name Server Operations Guide for BIND
142
143
144
1454th Berkeley Distribution 2004-10-31 RESOLV.CONF(5)