1.\" Copyright (c) 1986, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 33.\" $FreeBSD$ 34.\" 35.Dd December 7, 2003 36.Dt RESOLVER 5 37.Os 38.Sh NAME 39.Nm resolver 40.Nd resolver configuration file 41.Sh SYNOPSIS 42.Nm resolv.conf 43.Sh DESCRIPTION 44The 45.Xr resolver 3 46is a set of routines in the C library 47which provide access to the Internet Domain Name System. 48The resolver configuration file contains information that is read 49by the resolver routines the first time they are invoked by a process. 50The file is designed to be human readable and contains a list of 51keywords with values that provide various types of resolver information. 52.Pp 53On a normally configured system this file should not be necessary. 54The only name server to be queried will be on the local machine, 55the domain name is determined from the host name, 56and the domain search path is constructed from the domain name. 57.Pp 58The different configuration options are: 59.Bl -tag -width nameserver 60.It Sy nameserver 61Internet address (in dot notation) of a name server 62that the resolver should query. 63Up to 64.Dv MAXNS 65(currently 3) name servers may be listed, 66one per keyword. 67If there are multiple servers, 68the resolver library queries them in the order listed. 69If no 70.Sy nameserver 71entries are present, 72the default is to use the name server on the local machine. 73(The algorithm used is to try a name server, and if the query times out, 74try the next, until out of name servers, 75then repeat trying all the name servers 76until a maximum number of retries are made). 77.It Sy domain 78Local domain name. 79Most queries for names within this domain can use short names 80relative to the local domain. 81If no 82.Sy domain 83entry is present, the domain is determined 84from the local host name returned by 85.Xr gethostname 3 ; 86the domain part is taken to be everything after the first 87.Ql \&. . 88Finally, if the host name does not contain a domain part, the root 89domain is assumed. 90.It Sy search 91Search list for host-name lookup. 92The search list is normally determined from the local domain name; 93by default, it contains only the local domain name. 94This may be changed by listing the desired domain search path 95following the 96.Sy search 97keyword with spaces or tabs separating 98the names. 99Most resolver queries will be attempted using each component 100of the search path in turn until a match is found. 101Note that this process may be slow and will generate a lot of network 102traffic if the servers for the listed domains are not local, 103and that queries will time out if no server is available 104for one of the domains. 105.Pp 106The search list is currently limited to six domains 107with a total of 256 characters. 108.It Sy sortlist 109Sortlist allows addresses returned by gethostbyname to be sorted. 110A sortlist is specified by IP address netmask pairs. 111The netmask is 112optional and defaults to the natural netmask of the net. 113The IP address 114and optional network pairs are separated by slashes. 115Up to 10 pairs may 116be specified. 117E.g., 118.Pp 119.Dl "sortlist 130.155.160.0/255.255.240.0 130.155.0.0" 120.It Sy options 121Options allows certain internal resolver variables to be modified. 122The syntax is 123.Pp 124\fBoptions\fP \fIoption\fP \fI...\fP 125.Pp 126where 127.Sy option 128is one of the following: 129.Pp 130.Bl -tag -width no_tld_query 131.It Sy debug 132sets 133.Dv RES_DEBUG 134in _res.options. 135.It Sy ndots: Ns Ar n 136sets a threshold for the number of dots which must appear in a name given to 137.Fn res_query 138(see 139.Xr resolver 3 ) 140before an 141.Em initial absolute query 142will be made. 143The default for 144.Em n 145is 146.Dq 1 , 147meaning that if there are any dots in a name, the name 148will be tried first as an absolute name before any 149.Em search list 150elements are appended to it. 151.It Sy timeout: Ns Ar n 152sets the amount of time the resolver will wait for a response from a remote 153name server before retrying the query via a different name server. 154Measured in seconds, the default is 155.Dv RES_TIMEOUT 156(see 157.In resolv.h ) . 158.It Sy attempts: Ns Ar n 159sets the number of times the resolver will send a query to its name servers 160before giving up and returning an error to the calling application. 161The default is 162.Dv RES_DFLRETRY 163(see 164.In resolv.h ) . 165.It Sy no_tld_query 166tells the resolver not to attempt to resolve a top level domain name, that 167is, a name that contains no dots. 168Use of this option does not prevent 169the resolver from obeying the standard 170.Sy domain 171and 172.Sy search 173rules with the given name. 174.El 175.Pp 176Options may also be specified as a space or tab separated list using the 177.Dv RES_OPTIONS 178environment variable. 179.El 180.Pp 181The 182.Sy domain 183and 184.Sy search 185keywords are mutually exclusive. 186If more than one instance of these keywords is present, 187the last instance will override. 188.Pp 189The keyword and value must appear on a single line, and the keyword 190(e.g.\& 191.Sy nameserver ) 192must start the line. 193The value follows the keyword, separated by white space. 194.Sh FILES 195.Bl -tag -width /etc/resolv.conf -compact 196.It Pa /etc/resolv.conf 197The file 198.Nm resolv.conf 199resides in 200.Pa /etc . 201.El 202.Sh SEE ALSO 203.Xr gethostbyname 3 , 204.Xr resolver 3 , 205.Xr hostname 7 , 206.Xr named 8 207.Rs 208.%T "Name Server Operations Guide for BIND" 209.Re 210.Sh HISTORY 211The 212.Nm resolv.conf 213file format appeared in 214.Bx 4.3 . 215