RESOLV.CONF(5) | File Formats Manual | RESOLV.CONF(5) |
resolv.conf
—
resolver configuration file
The resolv.conf
file specifies how the
resolver(3) routines in the
C library (which provide access to the Internet Domain Name System) should
operate. The resolver configuration file contains information that is read
by the resolver routines the first time they are invoked by a process. The
file is designed to be human readable and contains a list of keywords with
values that provide various types of resolver information.
On a normally configured system this file should not be necessary. The only name server to be queried will be on the local machine, the domain name is determined from the host name, and the domain search path is constructed from the domain name.
The different configuration options are:
MAXNS
(currently 3) name servers may be listed,
one per keyword. If there are multiple servers, the resolver library
queries them in the order listed. If no nameserver
entries are present, the default is to use the name server on the local
machine. (The algorithm used is to try a name server, and if the query
times out, try the next, until out of name servers, then repeat trying all
the name servers until a maximum number of retries are made).The search list is currently limited to six domains with a total of 1024 characters.
sortlist 130.155.160.0/255.255.240.0 130.155.0.0
options option ...
where option is one of the following:
RES_TIMEOUT
(see
⟨resolv.h⟩).RES_DFLRETRY
(see
⟨resolv.h⟩).RES_ROTATE
in
_res.options, which causes round robin selection
of nameservers from among those listed. This has the effect of
spreading the query load among all listed servers, rather than having
all clients try the first listed server first every time.RES_NOCHECKNAME
in
_res.options, which disables the modern BIND
checking of incoming host names and mail names for invalid characters
such as underscore (‘_’), non-ASCII, or control
characters.RES_NOCHECKNAME
in
_res.options, which enables the modern BIND
checking of incoming host names and mail names as described above.
This is the default.RES_NOTLDQUERY
in
_res.options. This option causes
res_nsearch
()
to not attempt to resolve a unqualified name as if it were a top level
domain (TLD). This option can cause problems if the site has
“localhost” as a TLD rather than having localhost on one
or more elements of the search list. This option has no effect if
neither RES_DEFNAMES
or
RES_DNSRCH
is set.The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance will override.
The search keyword of a system's
resolv.conf file can be overridden on a per-process
basis by setting the environment variable
LOCALDOMAIN
to a space-separated list of search
domains.
The options keyword of a system's
resolv.conf file can be amended on a per-process
basis by setting the environment variable
RES_OPTIONS
to a space-separated list of resolver
options as explained above.
The keyword and value must appear on a single line, and the keyword (e.g. nameserver) must start the line. The value follows the keyword, separated by white space.
resolv.conf
resides in
/etc.gethostbyname(3), resolver(3), nsswitch.conf(5), hostname(7), named(8), resolvconf(8)
Paul Vixie, Kevin J. Dunlap, and Michael J. Karels, Name Server Operations Guide for BIND, CSRG,, Department of Electrical Engineering and Computer Sciences,, University of California, Berkeley, Release 4.9.4, https://web.archive.org/web/20100703030125/http://www.dns.net/dnsrd/docs/bog/bog.html, July 16, 1996.
The resolv.conf
file format appeared in
4.3BSD.
September 7, 2024 | NetBSD 10.99 |