resolv.confのヘルプ・マニュアル
日本語 英語
resolv.conf --help
man resolv.conf
RESOLV.CONF(5) Linux Programmer’s Manual RESOLV.CONF(5)
名前
resolv.conf - レゾルバ設定ファイル
書式
/etc/resolv.conf
説明
resolver は、インターネットドメインネームシステム (DNS) へのアクセスを
提供する C ライブラリのルーチン群である。レゾルバ設定ファイルには、レゾ
ル バルーチンがプロセスによって起動されたときに始めに読み込まれる情報が
含まれる。このファイルは人間に可読なように設計されている。キーワード と
値のリストが含まれ、いろいろなタイプのレゾルバ情報を提供する。
普 通に設定されたシステムでは、このファイルは必要ない。問い合わせをされ
る唯一のネームサーバはローカルマシン上にある。ドメイン名はホスト名か ら
決定され、ドメインの検索パスはドメイン名から作成される。
この状態を変更するための設定オプションには、以下のようなものがある。
nameserver ネームサーバの IP アドレス
レゾルバが問い合わせをするネームサーバの (ドット表記の) インター
ネットアドレス。このキーワード 1 つごとに 1 台づつ、 MAXNS 台 (
現状では 3 台、 を参照) までのネームサーバをリストでき
る。複数のサーバが指定された場合、レゾルバライブラリはリストされ
た順に問い合わせを行う。 nameserver エントリがない場合、デフォル
トではローカルマシン上のネームサーバが使われる。 (ここで使われる
アルゴリズムは以下のようなものである。はじめにネームサーバに問い
合わせを試みる。この問い合わせがタイムアウトになった場合、次のネ
ームサーバに問い合わせを試みる。これをネームサーバがなくなるまで
続ける。それでも応答がない場合は、リトライ最大回数に達するまで全
てのネームサーバに問い合わせを繰り返す。)
domain ローカルドメイン名
このドメインにある名前の問い合わせのほとんどに、このローカルドメ
インにおける短い名前を使用することができる。 domain エントリがな
い場合、ドメイン名は gethostname(2) で返されるローカルホスト名か
ら決定され、最初の '.' 以降の全ての部分がドメイン名とされる。 こ
のホスト名にもドメイン部を含んでいない場合、ルートドメインが仮定
される。
search ホスト名ルックアップのための検索リスト
検索リストは通常ローカルドメイン名から決定される。デフォルトでは
、 検 索リストはローカルドメイン名のみである。これを変更するには
、search キーワードの後に希望するドメイン検索パスをスペースま た
はタブで区切ってリストすればよい。ドットの数が ndots (デフォルト
では 1) より少ないレゾルバの問い合わせは、一致するものが見つかる
まで検索パスの各要素を順に使って試す。複数のサブドメインを持つ環
境では、第三者による攻撃 (man-in-the-middle attack) とルート DNS
サ ー バ へ の不必要なトラフィックを避けるために、以下の options
ndots:n を読んでほしい。このプロセスは遅く、リストされたドメイン
がローカルのものでない場合、多大なネットワークトラフィックを発生
させることに注意すること。さらに、これらのドメインのいずれかひと
つにでも適切なサーバがない場合、問い合わせがタイムアウトになる点
にも注意すること。
現状では、検索リストは 6 ドメイン・計 256 文字に制限されている。
sortlist
sortlist により、 gethostbyname(3) で返されるアドレスをソートさ
せることができる。 sortlist は IP アドレスとネットマスクのペアで
指定される。ネットマスクは省略可能であり、デフォルトではネットに
対するデフォルトのネットマスクである。 IP アドレスとオプションの
ネットマスクのペアはスラッシュで区切る。最大 10 組のペアを指定で
きる。例:
sortlist 130.155.160.0/255.255.240.0 130.155.0.0
options
options により、レゾルバの内部変数を変更することができる。書式は
以下の通りである。
options option ...
ここで option は次のうちのいずれかである。
debug _res.options を RES_DEBUG に設定する。
ndots:n
「 最 初 の 完 全 な 名前での問い合わせが実行される前に、
res_query(3) (resolver(3) を参照) に与えられる名前に含 ま
れているべきドットの数の閾値」を設定する。 n のデフォルト
は 1 である。これは、名前にドットがある場合、search list
の 要素が付加される前に、その名前が完全な名前として最初に
試されるということを意味している。
timeout:n
「レゾルバが他のネームサーバで問い合わせをリトライする 前
に 、リモートネームサーバからの応答を待つ時間」を設定する
。単位は秒で、デフォルトは RES_TIMEOUT である (現状では 5
秒、 を参照)。
attempts:n
「 レゾルバが諦めて呼び出し元のアプリケーションにエラーを
返すまでに、ネームサーバに問い合わせを行う回数」を設定 す
る 。 デ フ ォルトは RES_DFLRETRY 回である (現状では 2 回
、 を参照)。
rotate _res.options を RES_ROTATE に設定する。リストされているネ
ームサーバから選ぶときに、ラウンドロビン (round robin) 選
択を行わせる。リストされている全てのサーバで問い合わせ の
負 荷を分散する効果があり、最初にリストされたサーバに全て
のクライアントが毎回最初に問い合わせを行うわけではなく な
る。
no-check-names
_res.options を RES_NOCHECKNAME に設定する。入ってくるホ
スト名とメールアドレスに、アンダースコア (_)・ASCII 以 外
の 文字・制御文字といった不正な文字が含まれていないかを調
べる最近の BIND のチェックを無効にする。
inet6 _res.options を RES_USE_INET6 に設定 す る 。 gethostby-
name(3) 関 数 の内部で A レコードの問い合わせを行う前に
AAAA レコードの問い合わせを行わせたり、 AAAA レコードは見
つからないが A レコードセットが存在する場合に、 IPv4 の応
答を IPv6「トンネル形式」にマップさせたりする。
domain と search キーワードは、互いに排他的である。これらのキーワードが
2 つ以上記述されている場合、最後に記述されているものが有効になる。
システムの resolv.conf ファイルにある search キーワードは、スペースで区
切った検索ドメインのリストを環境変数 LOCALDOMAIN に設定することにより、
各プロセス毎に上書きすることができる。
シ ス テ ム の resolv.conf ファイルにある options キーワードは、上の
options セクションで説明したように、スペースで区切ったレゾルバオプシ ョ
ンのリストを環境変数 RES_OPTIONS に設定することにより、各プロセス毎に修
正することができる。
キーワードと値は同じ行に書かなければならない。また、(nameserver のよ う
な) キーワードが行の先頭になければならない。値はキーワードの後にスペー
スで区切って続ける。
ファイル
/etc/resolv.conf,
関連項目
gethostbyname(3), resolver(3), hostname(7), named(8)
BIND のネームサーバオペレーションガイド
4th Berkeley Distribution 2004-10-31 RESOLV.CONF(5)
RESOLV.CONF(5) Linux Programmer’s Manual RESOLV.CONF(5)
NAME
resolv.conf - resolver configuration file
SYNOPSIS
/etc/resolv.conf
DESCRIPTION
The resolver is a set of routines in the C library that provide access
to the Internet Domain Name System (DNS). 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 hostname and the domain search path is con-
structed from the domain name.
The different configuration options are:
nameserver Name server IP address
Internet address (in dot notation) of a name server that the
resolver should query. Up to MAXNS (currently 3, see
) 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.)
domain Local domain name.
Most queries for names within this domain can use short names
relative to the local domain. If no domain entry is present,
the domain is determined from the local hostname returned by
gethostname(2); the domain part is taken to be everything after
the first '.'. Finally, if the hostname 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 follow-
ing the search keyword with spaces or tabs separating the names.
Resolver queries having fewer than ndots dots (default is 1) in
them will be attempted using each component of the search path
in turn until a match is found. For environments with multiple
subdomains please read options ndots:n below to avoid man-in-
the-middle attacks and unnecessary traffic for the root-dns-
servers. 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 avail-
able for one of the domains.
The search list is currently limited to six domains with a total
of 256 characters.
sortlist
This option allows addresses returned by gethostbyname(3) 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 sepa-
rated by slashes. Up to 10 pairs may be specified. Here is an
example:
sortlist 130.155.160.0/255.255.240.0 130.155.0.0
options
Options allows certain internal resolver variables to be modi-
fied. The syntax is
options option ...
where option is one of the following:
debug sets RES_DEBUG in _res.options.
ndots:n
sets a threshold for the number of dots which must appear
in a name given to res_query(3) (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. The maximum
value for this option is silently capped to 15.
timeout:n
sets the amount of time the resolver will wait for a
response from a remote name server before retrying the
query via a different name server. Measured in seconds,
the default is RES_TIMEOUT (currently 5, see ).
The maximum value for this option is silently capped to
30.
attempts:n
sets the number of times the resolver will send a query
to its name servers before giving up and returning an
error to the calling application. The default is
RES_DFLRETRY (currently 2, see ). The maximum
value for this option is silently capped to 5.
rotate sets 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.
no-check-names
sets RES_NOCHECKNAME in _res.options, which disables the
modern BIND checking of incoming hostnames and mail names
for invalid characters such as underscore (_), non-ASCII,
or control characters.
inet6 sets RES_USE_INET6 in _res.options. This has the effect
of trying a AAAA query before an A query inside the geth-
ostbyname(3) function, and of mapping IPv4 responses in
IPv6 "tunneled form" if no AAAA records are found but an
A record set exists.
ip6-bytestring (since glibc 2.3.4)
sets RES_USE_BSTRING in _res.options. This causes
reverse IPv6 lookups to be made using the bit-label for-
mat described in RFC 2673; if this option is not set,
then nibble format is used.
ip6-dotint/no-ip6-dotint (since glibc 2.3.4)
Clear/set RES_NOIP6DOTINT in _res.options. When this
option is clear (ip6-dotint), reverse IPv6 lookups are
made in the (deprecated) ip6.int zone; when this option
is set (no-ip6-dotint), reverse IPv6 lookups are made in
the ip6.arpa zone by default. This option is set by
default.
edns0 (since glibc 2.6)
sets RES_USE_EDNSO in _res.options. This enables support
for the DNS extensions described in RFC 2671.
single-request (since glibc 2.10)
sets RES_SNGLKUP in _res.options. By default, glibc per-
forms IPv4 and IPv6 lookups in parallel since version
2.9. Some appliance DNS servers cannot handle these
queries properly and make the requests time out. This
option disables the behavior and makes glibc perform the
IPv6 and IPv4 requests sequentially (at the cost of some
slowdown of the resolving process).
single-request-reopen (since glibc 2.9)
The resolver uses the same socket for the A and AAAA
requests. Some hardware mistakenly only sends back one
reply. When that happens the client sytem will sit and
wait for the second reply. Turning this option on
changes this behavior so that if two requests from the
same port are not handled correctly it will close the
socket and open a new one before sending the second
request.
The domain and search keywords are mutually exclusive. If more than
one instance of these keywords is present, the last instance wins.
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 under
options.
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.
FILES
/etc/resolv.conf,
SEE ALSO
gethostbyname(3), resolver(3), hostname(7), named(8)
Name Server Operations Guide for BIND
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
4th Berkeley Distribution 2009-03-01 RESOLV.CONF(5)