1RESOLV.CONF(5)             Linux Programmer's Manual            RESOLV.CONF(5)
2
3
4

NAME

6       resolv.conf - resolver configuration file
7

SYNOPSIS

9       /etc/resolv.conf
10

DESCRIPTION

12       The  resolver is a set of routines in the C library that provide access
13       to the Internet Domain Name System (DNS).  The  resolver  configuration
14       file  contains  information  that  is read by the resolver routines the
15       first time they are invoked by a process.  The file is designed  to  be
16       human readable and contains a list of keywords with values that provide
17       various types of resolver information.
18
19       If this file does not exist, only the name server on the local  machine
20       will  be  queried;  the domain name is determined from the hostname and
21       the domain search path is constructed from the domain name.
22
23       The different configuration options are:
24
25       nameserver Name server IP address
26              Internet address of a  name  server  that  the  resolver  should
27              query,  either  an  IPv4  address  (in dot notation), or an IPv6
28              address in colon (and possibly dot) notation as  per  RFC  2373.
29              Up  to  MAXNS  (currently 3, see <resolv.h>) name servers may be
30              listed, one per keyword.  If there  are  multiple  servers,  the
31              resolver  library queries them in the order listed.  If no name‐
32              server entries are present, the  default  is  to  use  the  name
33              server  on  the  local machine.  (The algorithm used is to try a
34              name server, and if the query times out, try the next, until out
35              of name servers, then repeat trying all the name servers until a
36              maximum number of retries are made.)
37
38       domain Local domain name.
39              Most queries for names within this domain can  use  short  names
40              relative to the local domain.  If set to '.', the root domain is
41              considered.  If no domain entry is present, the domain is deter‐
42              mined  from  the  local hostname returned by gethostname(2); the
43              domain part is taken to  be  everything  after  the  first  '.'.
44              Finally,  if  the  hostname  does not contain a domain part, the
45              root domain is assumed.
46
47       search Search list for host-name lookup.
48              The search list is normally determined  from  the  local  domain
49              name;  by default, it contains only the local domain name.  This
50              may be changed by listing the desired domain search path follow‐
51              ing the search keyword with spaces or tabs separating the names.
52              Resolver queries having fewer than ndots dots (default is 1)  in
53              them  will  be attempted using each component of the search path
54              in turn until a match is found.  For environments with  multiple
55              subdomains  please  read  options ndots:n below to avoid man-in-
56              the-middle attacks and unnecessary  traffic  for  the  root-dns-
57              servers.  Note that this process may be slow and will generate a
58              lot of network traffic if the servers for the listed domains are
59              not local, and that queries will time out if no server is avail‐
60              able for one of the domains.
61
62              The search list is currently limited to six domains with a total
63              of 256 characters.
64
65       sortlist
66              This  option allows addresses returned by gethostbyname(3) to be
67              sorted.  A sortlist is specified  by  IP-address-netmask  pairs.
68              The  netmask  is optional and defaults to the natural netmask of
69              the net.  The IP address and optional network  pairs  are  sepa‐
70              rated  by slashes.  Up to 10 pairs may be specified.  Here is an
71              example:
72
73                  sortlist 130.155.160.0/255.255.240.0 130.155.0.0
74
75       options
76              Options allows certain internal resolver variables to  be  modi‐
77              fied.  The syntax is
78
79                     options option ...
80
81              where option is one of the following:
82
83              debug  sets  RES_DEBUG  in _res.options (effective only if glibc
84                     was built with debug support; see resolver(3)).
85
86              ndots:n
87                     sets a threshold for the number of dots which must appear
88                     in  a name given to res_query(3) (see resolver(3)) before
89                     an initial absolute query will be made.  The default  for
90                     n is 1, meaning that if there are any dots in a name, the
91                     name will be tried first as an absolute name  before  any
92                     search  list  elements are appended to it.  The value for
93                     this option is silently capped to 15.
94
95              timeout:n
96                     sets the amount of time the  resolver  will  wait  for  a
97                     response  from  a  remote name server before retrying the
98                     query via a different name server.  Measured in  seconds,
99                     the default is RES_TIMEOUT (currently 5, see <resolv.h>).
100                     The value for this option is silently capped to 30.
101
102              attempts:n
103                     sets the number of times the resolver will send  a  query
104                     to  its  name  servers  before giving up and returning an
105                     error  to  the  calling  application.   The  default   is
106                     RES_DFLRETRY  (currently  2,  see <resolv.h>).  The value
107                     for this option is silently capped to 5.
108
109              rotate sets RES_ROTATE in _res.options, which causes round-robin
110                     selection  of  nameservers from among those listed.  This
111                     has the effect of spreading  the  query  load  among  all
112                     listed  servers,  rather  than having all clients try the
113                     first listed server first every time.
114
115              no-check-names
116                     sets RES_NOCHECKNAME in _res.options, which disables  the
117                     modern BIND checking of incoming hostnames and mail names
118                     for invalid characters such as underscore (_), non-ASCII,
119                     or control characters.
120
121              inet6  sets  RES_USE_INET6 in _res.options.  This has the effect
122                     of trying a AAAA query before an A query inside the geth‐
123                     ostbyname(3)  function,  and of mapping IPv4 responses in
124                     IPv6 "tunneled form" if no AAAA records are found but  an
125                     A record set exists.
126
127              ip6-bytestring (since glibc 2.3.4)
128                     sets   RES_USE_BSTRING   in  _res.options.   This  causes
129                     reverse IPv6 lookups to be made using the bit-label  for‐
130                     mat  described  in  RFC 2673;  if this option is not set,
131                     then nibble format is used.
132
133              ip6-dotint/no-ip6-dotint (since glibc 2.3.4)
134                     Clear/set RES_NOIP6DOTINT  in  _res.options.   When  this
135                     option  is  clear  (ip6-dotint), reverse IPv6 lookups are
136                     made in the (deprecated) ip6.int zone; when  this  option
137                     is  set (no-ip6-dotint), reverse IPv6 lookups are made in
138                     the ip6.arpa zone by default.   This  option  is  set  by
139                     default.
140
141              edns0 (since glibc 2.6)
142                     sets RES_USE_EDNSO in _res.options.  This enables support
143                     for the DNS extensions described in RFC 2671.
144
145              single-request (since glibc 2.10)
146                     sets RES_SNGLKUP in _res.options.  By default, glibc per‐
147                     forms  IPv4  and  IPv6  lookups in parallel since version
148                     2.9.  Some appliance  DNS  servers  cannot  handle  these
149                     queries  properly  and  make the requests time out.  This
150                     option disables the behavior and makes glibc perform  the
151                     IPv6  and IPv4 requests sequentially (at the cost of some
152                     slowdown of the resolving process).
153
154              single-request-reopen (since glibc 2.9)
155                     The resolver uses the same socket  for  the  A  and  AAAA
156                     requests.   Some  hardware mistakenly sends back only one
157                     reply.  When that happens the client system will sit  and
158                     wait  for  the  second  reply.   Turning  this  option on
159                     changes this behavior so that if two  requests  from  the
160                     same  port  are  not  handled correctly it will close the
161                     socket and open a  new  one  before  sending  the  second
162                     request.
163
164       The  domain  and  search keywords are mutually exclusive.  If more than
165       one instance of these keywords is present, the last instance wins.
166
167       The search keyword of a system's resolv.conf file can be overridden  on
168       a  per-process basis by setting the environment variable LOCALDOMAIN to
169       a space-separated list of search domains.
170
171       The options keyword of a system's resolv.conf file can be amended on  a
172       per-process  basis by setting the environment variable RES_OPTIONS to a
173       space-separated list of  resolver  options  as  explained  above  under
174       options.
175
176       The  keyword  and  value  must appear on a single line, and the keyword
177       (e.g., nameserver) must start the line.  The value follows the keyword,
178       separated by white space.
179
180       Lines  that  contain a semicolon (;) or hash character (#) in the first
181       column are treated as comments.
182

FILES

184       /etc/resolv.conf, <resolv.h>
185

SEE ALSO

187       gethostbyname(3), resolver(3), hostname(7), named(8)
188       Name Server Operations Guide for BIND
189

COLOPHON

191       This page is part of release 3.53 of the Linux  man-pages  project.   A
192       description  of  the project, and information about reporting bugs, can
193       be found at http://www.kernel.org/doc/man-pages/.
194
195
196
1974th Berkeley Distribution         2013-07-31                    RESOLV.CONF(5)
Impressum