cvsdist bde40aa
.\" Copyright (c) 1986 The Regents of the University of California.
cvsdist bde40aa
.\" All rights reserved.
cvsdist bde40aa
.\"
cvsdist bde40aa
.\" Redistribution and use in source and binary forms are permitted
cvsdist bde40aa
.\" provided that the above copyright notice and this paragraph are
cvsdist bde40aa
.\" duplicated in all such forms and that any documentation,
cvsdist bde40aa
.\" advertising materials, and other materials related to such
cvsdist bde40aa
.\" distribution and use acknowledge that the software was developed
cvsdist bde40aa
.\" by the University of California, Berkeley.  The name of the
cvsdist bde40aa
.\" University may not be used to endorse or promote products derived
cvsdist bde40aa
.\" from this software without specific prior written permission.
cvsdist bde40aa
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
cvsdist bde40aa
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
cvsdist bde40aa
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
cvsdist bde40aa
.\"
cvsdist bde40aa
.\"	@(#)resolver.5	5.9 (Berkeley) 12/14/89
cvsdist bde40aa
.\"	$Id: resolver.5,v 8.6 1999/05/21 00:01:02 vixie Exp $
cvsdist bde40aa
.\"
cvsdist c219fb5
.\"     Revised by Mike MacCana
cvsdist c219fb5
.\"
cvsdist c219fb5
.Dd June 23, 2004
cvsdist bde40aa
.Dt RESOLVER 5 
cvsdist bde40aa
.Os BSD 4
cvsdist bde40aa
.Sh NAME
cvsdist bde40aa
.Nm resolver 
cvsdist c219fb5
.Nd DNS client
cvsdist bde40aa
.Sh SYNOPSIS
cvsdist bde40aa
.Pa /etc/resolv.conf
cvsdist bde40aa
.Sh DESCRIPTION
cvsdist bde40aa
The
cvsdist bde40aa
.Nm resolver
cvsdist c219fb5
is the DNS client used on most Linux and BSD systems. It comes with glibc. 
cvsdist c219fb5
Its configuration file 
cvsdist c219fb5
.Pa /etc/resolv.conf 
cvsdist c219fb5
(note the spelling) determines the DNS servers to use, and various other options - see below.
cvsdist c219fb5
.Pp
cvsdist c219fb5
Almost all machines have a DNS server set up in this file - if it
cvsdist c219fb5
doesn't exist, the system will assume there's a DNS server running on the local 
cvsdist c219fb5
machine, and work out the search path from the machines domain name.
cvsdist bde40aa
.Pp
cvsdist c219fb5
The config file is read the first time the DNS client is invoked by a process.
cvsdist bde40aa
.Pp
cvsdist c219fb5
The different configuration options are:
cvsdist c219fb5
.Bl -tag -width "nameserver"
cvsdist bde40aa
.It Li nameserver
cvsdist c219fb5
IP address of a DNS server to use. Multiple name servers may be listed, each on their own line. The 
cvsdist bde40aa
.Nm resolver 
cvsdist c219fb5
will use them in order listed - if the first server times out answering the query, the next server will be tried, and so on. If the
cvsdist c219fb5
.Li resolver
cvsdist c219fb5
runs out out of name servers, the first server will be queried again, until a maximum number of retries are made. 
cvsdist c219fb5
.Pp 
cvsdist c219fb5
The maximum number of DNS servers to use is set by 
cvsdist bde40aa
.Dv MAXNS 
cvsdist bde40aa
(see
cvsdist c219fb5
.Pa <resolv.h>
cvsdist c219fb5
)
cvsdist bde40aa
.It Li search
cvsdist c219fb5
Domain(s) to use for DNS lookups when no domain is specified. List each domain 
cvsdist c219fb5
following the
cvsdist c219fb5
.Li search
cvsdist c219fb5
keyword with spaces or tabs between them. Each possible domain will be checked in order until a match is found. Note that this process may be slow (queries will time out if no server is available for a domain) and will generate a lot of network traffic if the servers for the listed domains aren't local.
cvsdist c219fb5
.Pp
cvsdist c219fb5
The search list is currently limited to six domains with a total of 256 characters.
cvsdist c219fb5
If
cvsdist c219fb5
.Li search
cvsdist c219fb5
isn't specified, the search list will be determined from the local domain name (whatever comes after the first dot). If the host name doesn't contain a domain, the root domain is used. 
cvsdist c219fb5
.Pp
cvsdist c219fb5
By default, it 
cvsdist c219fb5
.Li search
cvsdist c219fb5
contains only the local domain name.
cvsdist c219fb5
.It Li domain
cvsdist c219fb5
Local domain name. You can use this instead of the 
cvsdist c219fb5
.Li search
cvsdist c219fb5
option to specify a single domain to check if a hostname isn't specified. Most people just use 
cvsdist c219fb5
.Li search
cvsdist c219fb5
instead (that option lets you use multiple servers, 
cvsdist c219fb5
.Li domain
cvsdist c219fb5
doesn't). You can't use 
cvsdist c219fb5
.Li domain
cvsdist c219fb5
and
cvsdist c219fb5
.Li search
cvsdist c219fb5
at the same time - they're mutually exclusive. 
cvsdist bde40aa
.Pp
cvsdist c219fb5
If
cvsdist c219fb5
.Li domain
cvsdist c219fb5
isn't specified, the domain will be determined from the local domain name (whatever comes after the first dot). If the host name doesn't contain a domain, the root domain is used.
cvsdist bde40aa
.It Li sortlist
cvsdist c219fb5
Sorts addresses returned by the
cvsdist c219fb5
.Li gethostbyname 
cvsdist c219fb5
system call.
cvsdist c219fb5
A
cvsdist bde40aa
.Li sortlist 
cvsdist bde40aa
is specified by IP address netmask pairs. The netmask is
cvsdist bde40aa
optional and defaults to the natural netmask of the net. The IP address
cvsdist bde40aa
and optional network pairs are separated by slashes. Up to 10 pairs may
cvsdist bde40aa
be specified.  For example:
cvsdist bde40aa
.Bd -literal -offset indent
cvsdist bde40aa
sortlist 130.155.160.0/255.255.240.0 130.155.0.0
cvsdist bde40aa
.Ed
cvsdist bde40aa
.It Li options
cvsdist bde40aa
Allows certain internal 
cvsdist bde40aa
.Nm resolver 
cvsdist bde40aa
variables to be modified.
cvsdist bde40aa
The syntax is
cvsdist bde40aa
.D1 Li options Ar option ...
cvsdist bde40aa
where 
cvsdist bde40aa
.Ar option 
cvsdist bde40aa
is one of the following:
cvsdist bde40aa
.Bl -tag -width "ndots:n " 
cvsdist bde40aa
.It Li debug 
cvsdist bde40aa
sets 
cvsdist bde40aa
.Dv RES_DEBUG 
cvsdist bde40aa
in 
cvsdist bde40aa
.Ft _res.options .
cvsdist bde40aa
.It Li ndots: Ns Ar n 
cvsdist bde40aa
sets a threshold for the number of dots which
cvsdist bde40aa
must appear in a name given to 
cvsdist bde40aa
.Fn res_query 
cvsdist bde40aa
(see 
cvsdist bde40aa
.Xr resolver 3 )
cvsdist bde40aa
before an 
cvsdist bde40aa
.Em initial absolute query 
cvsdist bde40aa
will be made.  The default for
cvsdist bde40aa
.Ar n 
cvsdist bde40aa
is 
cvsdist bde40aa
.Dq 1 , 
cvsdist bde40aa
meaning that if there are 
cvsdist bde40aa
.Em any 
cvsdist bde40aa
dots in a name, the name will be tried first as an absolute name before any 
cvsdist bde40aa
.Em search list
cvsdist bde40aa
elements are appended to it.
cvsdist bde40aa
.It Li timeout: Ns Ar n
cvsdist bde40aa
sets the amount of time the resolver will wait for a response from a remote
cvsdist bde40aa
name server before retrying the query via a different name server.  Measured in
cvsdist bde40aa
seconds, the default is
cvsdist bde40aa
.Dv RES_TIMEOUT
cvsdist bde40aa
(see
cvsdist bde40aa
.Pa <resolv.h> ).
cvsdist bde40aa
.It Li attempts: Ns Ar n
cvsdist bde40aa
sets the number of times the resolver will send a query to its name servers
cvsdist bde40aa
before giving up and returning an error to the calling application.  The
cvsdist bde40aa
default is
cvsdist bde40aa
.Dv RES_DFLRETRY
cvsdist bde40aa
(see
cvsdist bde40aa
.Pa <resolv.h> ).
cvsdist bde40aa
.It Li rotate
cvsdist bde40aa
sets
cvsdist bde40aa
.Dv RES_ROTATE
cvsdist bde40aa
in
cvsdist bde40aa
.Ft _res.options ,
cvsdist bde40aa
which causes round robin selection of nameservers from among those listed.
cvsdist bde40aa
This has the effect of spreading the query load among all listed servers,
cvsdist bde40aa
rather than having all clients try the first listed server first every time.
cvsdist bde40aa
.It Li no-check-names
cvsdist bde40aa
sets
cvsdist bde40aa
.Dv RES_NOCHECKNAME
cvsdist bde40aa
in
cvsdist bde40aa
.Ft _res.options ,
cvsdist bde40aa
which disables the modern BIND checking of incoming host names and mail names
cvsdist bde40aa
for invalid characters such as underscore (_), non-ASCII, or control characters.
cvsdist bde40aa
.It Li inet6
cvsdist bde40aa
sets 
cvsdist bde40aa
.Dv RES_USE_INET6
cvsdist bde40aa
in 
cvsdist bde40aa
.Ft _res.options .
cvsdist bde40aa
This has the effect of trying a AAAA query before an A query inside the
cvsdist bde40aa
.Ft gethostbyname
cvsdist bde40aa
function, and of mapping IPv4 responses in IPv6 ``tunnelled form'' if no
cvsdist bde40aa
AAAA records are found but an A record set exists.
cvsdist bde40aa
.It Li ip6-dotint / no-ip6-dotint
cvsdist bde40aa
sets / clears the
cvsdist bde40aa
.Dv RES_NOIP6DOTINT
cvsdist bde40aa
bit in 
cvsdist bde40aa
.Ft _res.options ,
cvsdist bde40aa
which when set (ip6-dotint) will enable reverse IPv6 lookups to be made in the (deprecated) 
cvsdist bde40aa
ip6.int zone; when clear (no-ip6-dotint), reverse IPv6 lookups are made in the ip6.arpa zone 
cvsdist bde40aa
by default.
cvsdist bde40aa
.It Li ip6-bytestring
cvsdist bde40aa
sets
cvsdist bde40aa
.Dv RES_USEBSTRING
cvsdist bde40aa
in 
cvsdist bde40aa
.Ft _res.options .
cvsdist bde40aa
This causes reverse IPv6 lookups to be made using the bit-label 
cvsdist bde40aa
format of RFC 2673; if not set, then nibble format is used.
cvsdist bde40aa
.El
cvsdist bde40aa
.El
cvsdist bde40aa
.Pp
cvsdist bde40aa
The 
cvsdist bde40aa
.Li domain 
cvsdist bde40aa
and 
cvsdist bde40aa
.Li search 
cvsdist bde40aa
keywords are mutually exclusive.
cvsdist bde40aa
If more than one instance of these keywords is present,
cvsdist bde40aa
the last instance wins.
cvsdist bde40aa
.Pp
cvsdist bde40aa
The 
cvsdist bde40aa
.Li search 
cvsdist bde40aa
keyword of a system's 
cvsdist bde40aa
.Pa resolv.conf 
cvsdist bde40aa
file can be
cvsdist bde40aa
overridden on a per-process basis by setting the environment variable
cvsdist bde40aa
.Dq Ev LOCALDOMAIN 
cvsdist bde40aa
to a space-separated list of search domains.
cvsdist bde40aa
.Pp
cvsdist bde40aa
The 
cvsdist bde40aa
.Li options 
cvsdist bde40aa
keyword of a system's 
cvsdist bde40aa
.Pa resolv.conf 
cvsdist bde40aa
file can be amended on a per-process basis by setting the environment variable
cvsdist bde40aa
.Dq Ev RES_OPTIONS to a space-separated list of 
cvsdist bde40aa
.Nm resolver 
cvsdist bde40aa
options as explained above under 
cvsdist bde40aa
.Li options .
cvsdist bde40aa
.Pp
cvsdist bde40aa
The keyword and value must appear on a single line, and the keyword
cvsdist bde40aa
(e.g., 
cvsdist bde40aa
.Li nameserver ) 
cvsdist bde40aa
must start the line.  The value follows the keyword, separated by white space.
cvsdist bde40aa
.Sh FILES
cvsdist bde40aa
.Pa /etc/resolv.conf
cvsdist bde40aa
.Pa <resolv.h>
cvsdist bde40aa
.Sh SEE ALSO
cvsdist bde40aa
.Xr gethostbyname 3 , 
cvsdist bde40aa
.Xr hostname 7 , 
cvsdist bde40aa
.Xr named 8 ,
cvsdist bde40aa
.Xr resolver 3 , 
cvsdist bde40aa
.Xr resolver 5 .
cvsdist bde40aa
.Dq Name Server Operations Guide for Sy BIND