1RESOLVER(5) BSD File Formats Manual RESOLVER(5)
2
4 resolver — resolver configuration file
5
7 /etc/resolv.conf
8
10 The resolver is a set of routines in the C library (resolve(3)) that pro‐
11 vide access to the Internet Domain Name System. The resolver configura‐
12 tion file contains information that is read by the resolver routines the
13 first time they are invoked by a process. The file is designed to be
14 human readable and contains a list of keywords with values that provide
15 various types of resolver information.
16
17 On a normally configured system, this file should not be necessary. The
18 only name server to be queried will be on the local machine, the domain
19 name is determined from the host name, and the domain search path is con‐
20 structed from the domain name.
21
22 The different configuration directives are:
23
24 nameserver
25 Internet address (in dot notation) of a name server that the
26 resolver should query. Up to MAXNS (see <resolv.h>) name
27 servers may be listed, one per keyword. If there are multiple
28 servers, the resolver library queries them in the order listed.
29 If no nameserver entries are present, the default is to use the
30 name server on the local machine. (The algorithm used is to try
31 a name server, and if the query times out, try the next, until
32 out of name servers, then repeat trying all the name servers
33 until a maximum number of retries are made).
34
35 domain Local domain name. Most queries for names within this domain
36 can use short names relative to the local domain. If no domain
37 entry is present, the domain is determined from the local host
38 name returned by gethostname(3); the domain part is taken to be
39 everything after the first ‘.’. Finally, if the host name does
40 not contain a domain part, the root domain is assumed.
41
42 search Search list for host-name lookup. The search list is normally
43 determined from the local domain name; by default, it contains
44 only the local domain name. This may be changed by listing the
45 desired domain search path following the search keyword with
46 spaces or tabs separating the names. Most resolver queries will
47 be attempted using each component of the search path in turn
48 until a match is found. Note that this process may be slow and
49 will generate a lot of network traffic if the servers for the
50 listed domains are not local, and that queries will time out if
51 no server is available for one of the domains.
52
53 The search list is currently limited to six domains with a total
54 of 256 characters.
55
56 sortlist
57 Allows addresses returned by gethostbyname to be sorted. A
58 sortlist is specified by IP address netmask pairs. The netmask
59 is optional and defaults to the natural netmask of the net. The
60 IP address and optional network pairs are separated by slashes.
61 Up to 10 pairs may be specified. For example:
62
63 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
64
65 options Allows certain internal resolver variables to be modified. The
66 syntax is
67 options option ...
68 where option is one of the following:
69
70 debug sets RES_DEBUG in _res.options.
71
72 ndots:n sets a threshold for the number of dots which must
73 appear in a name given to res_query() (see
74 resolver(3)) before an initial absolute query will be
75 made. The default for n is “1”, meaning that if there
76 are any dots in a name, the name will be tried first
77 as an absolute name before any search list elements
78 are appended to it.
79
80 timeout:n
81 sets the amount of time the resolver will wait for a
82 response from a remote name server before retrying the
83 query via a different name server. Measured in sec‐
84 onds, the default is RES_TIMEOUT (see <resolv.h>).
85
86 attempts:n
87 sets the number of times the resolver will send a
88 query to its name servers before giving up and return‐
89 ing an error to the calling application. The default
90 is RES_DFLRETRY (see <resolv.h>).
91
92 rotate sets RES_ROTATE in _res.options, which causes round
93 robin selection of nameservers from among those
94 listed. This has the effect of spreading the query
95 load among all listed servers, rather than having all
96 clients try the first listed server first every time.
97
98 no-check-names
99 sets RES_NOCHECKNAME in _res.options, which disables
100 the modern BIND checking of incoming host names and
101 mail names for invalid characters such as underscore
102 (_), non-ASCII, or control characters.
103
104 inet6 sets RES_USE_INET6 in _res.options. This has the
105 effect of trying a AAAA query before an A query inside
106 the gethostbyname function, and of mapping IPv4
107 responses in IPv6 ``tunnelled form'' if no AAAA
108 records are found but an A record set exists.
109
110 no-tld-query
111 sets RES_NOTLDQUERY in _res.options. This option
112 causes res_nsearch() to not attempt to resolve a
113 unqualified name as if it were a top level domain
114 (TLD). This option can cause problems if the site has
115 "localhost" as a TLD rather than having localhost on
116 one or more elements of the search list. This option
117 has no effect if neither RES_DEFNAMES or RES_DNSRCH is
118 set.
119
120 The domain and search keywords are mutually exclusive. If more than one
121 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 a
124 per-process basis by setting the environment variable “LOCALDOMAIN” to a
125 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 to a
129 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), hostname(7), named(8), resolver(3), resolver(5). “Name
141 Server Operations Guide for BIND”
142
1434th Berkeley Distribution November 11, 1993 4th Berkeley Distribution