RESOLVER(5)

NAME
resolver - resolver configuration file

SYNOPSIS
/etc/resolv.conf

DESCRIPTION
The resolver and BIND9 lightwreight resolver are sets of routines in the C library and BIND9 library respectively that provide access to the Internet Domain Name System. The resolver configuration file, /etc/resolv.conf, is normally gets read by the resolver and lightweight resolver routines to initialise low-level resolver data structures the first time that a process invokes those routines. The file contains a list of keywords with values that provide various types of information, such as the IP addresses of the servers that should be used when making lookup requests.

Each keyword and value must appear on a single line. The value follows the keyword, separated by white space. The hash character '#' or semi-colon ';' introduce comments. Anything from either of these characters to the end of the line is treated as a comment and ignored.

The available configuration directives are:

nameserver
    Internet address of a name server that the resolver should query. The IP address of the server can be supplied in the usual notation: either in dotted-decimal form for an IPv4 addess or in double colon form described in RFC1884 for an IPv6 address. Up to three nameserver directives can be listed. See LWRES_CONFMAXNAMESERVERS in <lwres/lwres.h>. If more than LWRES_CONFMAXNAMESERVERS nameserver directives are present in the file, only the first three are used. Any others are ignored.

    When there are multiple servers, the resolver library queries them in the order listed. If no nameserver entries are present, the default is to attempt to use the name server or lightweight resolver daemon on the local machine. The algorithm used is to try a 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.

domain
    Local domain name. Most queries for names within this domain can use short names relative to the local domain. When no domain entry is present, the domain is determined from the local host name returned by gethostname(2); the domain part is taken to be everything after the first ‘’.. Finally, if the host name does not contain a domain part, the root domain is assumed.

search
    Search list for host-name lookup. The search list is normally determined from the local domain name; by default, it contains only the local domain name. This may be changed by listing the desired domain search path following the search keyword with spaces or tabs separating the names. Most resolver queries will be attempted using each component of the search path in turn until a match is found. Note that this process may be slow and will generate a lot of network traffic if the servers for the listed domains are not local, and that queries will time out if no server is available for one of the domains.

    The search list is currently limited to eight domains with a total of 256 characters. See LWRES_CONFMAXSEARCH and LWRES_CONFMAXLINELEN in lwres/lwres.h.

sortlist
    Allows addresses returned by gethostbyname to be sorted. A sortlist is specified by IP address netmask pairs. The netmask is optional and defaults to the natural netmask of the net. The IP address and optional network pairs are separated by slashes. Up to 10 pairs may be specified. For example:

        sortlist 130.155.160.0/255.255.240.0 130.155.0.0

options
    Allows certain internal resolver variables to be modified. The syntax is
        options option ...
    where option is one of the following:

    ndots:n
        sets a threshold for the number of dots which must appear in a name given to res_query() (see resolver(3)) before an initial absolute query will be made. The default for n is “1”, meaning that if there are any dots in a name, the name will be tried first as an absolute name before any search list elements are appended to it. Acceptable values of n are between 0 and 255 inclusive.

    debug
        enables debugging traces for the resolver XXXJR if anything actually looked at confdata->resdebug. At present the option is just recognised but not used by the BIND9 implementation.

    no_tld_query
        tells the resolver not to attempt to resolve a top level domain name, i.e. a name containing no dots. Use of this option does not prevent the resolver from obeying the standard domain and search rules with the given name. XXXJR At present this option is recognised but is otherwise unused in BIND9.

    missing
        XXXJR what about the other BIND8 resolver options like rotate and timeout? Shouldn't these be provided for backwards compatibility?

The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance wins.

FILES
/etc/resolv.conf <lwres/lwres.h>

SEE ALSO
gethostbyname(3), lwres_config(3), lwres(3), resolver(3), hostname(7), lwresd(8), named(8), "BIND9 Administrators Manual".

BUGS
Unrecognised directives and syntax errors in /etc/resolv.conf are usually silently ignored, though LWRES_R_FAILURE can be returned by the lightweight resolver functions described in lwres_config(3) which parse this file.