resolver 中文man页面

系统
解析器(resolver) 是 C 函数库 中 的 一组 例程, 用于 访问 Internet 域名系统. 当 某个 进程 第一次 调用 这些函数 时, 它们 读取 解析器配置文件 的 内容. 这个文件 很容易 理解, 它 由 关键字 和 对应值 的 列表 组成, 提供 各种类型的 解析器信息.

NAME

resolver - 解析器(resolver) 配置文件

总览 (SYNOPSIS)

/etc/resolv.conf

描述 (DESCRIPTION)

解析器(resolver) 是 C 函数库 中 的 一组 例程, 用于 访问 Internet 域名系统. 当 某个 进程 第一次 调用 这些函数 时, 它们 读取 解析器配置文件 的 内容. 这个文件 很容易 理解, 它 由 关键字 和 对应值 的 列表 组成, 提供 各种类型的 解析器信息.

正常 配置 的 系统 中, 这个 文件 并非 必不可少: 名字服务器 可以 位于 本机, 域名 从 主机名 中 获得, 域名搜索路径 由 域名 产生.

各种配置选项有:

nameserver
名字服务器 的 Internet 地址, 用于 解析器 查询. 最多 可以 列出 MAXNS (目前是 3) 个 名字服务器, 一个关键字 对应 一个服务器. 如果 列出 多个 服务器, 解析器 按照 列举的顺序 访问. 如果 没有 给出 nameserver 项, 缺省方法 是 使用 本机的 名字服务. (使用的算法 是 先试 第一个 名字服务器, 如果 请求 超时, 就试 下一个 服务器, 直到 试遍 所有的 服务器. 然后 重复 这个过程, 直到 最大 重试次数).
domain
本地域名. 多数 对 本域内 的 名字查询 能够 使用 对应的 短名字. 如果 domain 项 不存在, 本地域名 取决于 gethostname() 返回的 主机名: 第一个 '.' 以后的 所有内容 都是 域名 部分. 最后, 如果 主机名 不含有 域名 部分, 就认为 指定了 根域.
search
主机名查询 的 查找列表. 查找列表 一般 取决于 本地域名; 缺省情况下 就是 本地域名. 这一点 可以 改变, 在 关键字 search 后面, 隔着 空格 或 制表符, 列出 期望的 域名查找路径. 多数 解析请求 会 按顺序 尝试 查找路径 里的 每一个 成员, 直到 发现 匹配项. 注意, 如果 所列域名 对应的 服务器 不在 本地网络, 这个 过程 可能 很慢, 而且 生成 大量的 网络数据, 如果 其中的 某个域名 没有 对应的 服务器, 将导致 请求超时.
目前, 查找列表 限制在 六个 域名 内, 总共 不超过 256 个字符.
sortlist
排序列表 允许 对 gethostbyname 返回的 地址 排序. 排序列表 由 IP地址 和 屏蔽字 对 指明. 屏蔽字 是 可选项, 缺省是 网络的自然屏蔽字. IP地址 和 可选的屏蔽字 对 用 斜杠符 隔开. 最多 可以 指定 10 对.
例如: sortlist 130.155.160.0/255.255.240.0 130.155.0.0
options
选项, 允许 修改 某些 解析器 的 内部变量. 语法形式 是:
options option ...
这里的 option 是 下列 项目 之一:
debug --- 在 _res.options 中 设置 RES_DEBUG.
ndots:n --- 设置 句点数目 的 门限值, 如果要 直接 做 绝对查询, 传给 res_query (另见 resolver(3)) 的 名字中 的句点 不得小于 这个数. n 的 缺省值 是 ``1'', 意即 只要 名字中 有 一个 句点, 在 添加 查找列表 中 任何 成员 前, 首先 按 绝对名字 查询.

domainsearch 关键字 是 互斥的. 如果 它们 先后 出现, 则 最后一个 有效.

系统文件 resolv.conf 中的 search 关键字 能够 被 环境变量 ``LOCALDOMAIN'' 的 内容 取代, 域名列表 用 空格 隔开.

系统文件 resolv.conf 中的 options 关键字 能够 被 环境变量 ``RES_OPTIONS'' 的 内容 修正, 其中 的 选项 (见前面的 options) 用 空格 隔开.

关键字 及其 对应值 必须 列在 同一行, 而且 关键字(例如 nameserver) 必须 在 行始. 对应值 在后面 用 空白符(white space) 隔开.

文件 (FILES)

/etc/resolv.conf

另见 (SEE ALSO)

gethostbyname(3), hostname(7), named(8),
Name Server Operations Guide for BIND

#p#

NAME

resolver - DNS client  

SYNOPSIS

/etc/resolv.conf  

DESCRIPTION

The resolver is the DNS client used on most Linux and BSD systems. It comes with glibc. Its configuration file /etc/resolv.conf (note the spelling) determines the DNS servers to use, and various other options - see below.

Almost all machines have a DNS server set up in this file - if it doesn't exist, the system will assume there's a DNS server running on the local machine, and work out the search path from the machines domain name.

The config file is read the first time the DNS client is invoked by a process.

The different configuration options are:

nameserver
IP address of a DNS server to use. Multiple name servers may be listed, each on their own line. The resolver 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 resolver runs out out of name servers, the first server will be queried again, until a maximum number of retries are made.

The maximum number of DNS servers to use is set by MAXNS (see <resolv.h> )

search
Domain(s) to use for DNS lookups when no domain is specified. List each domain following the search 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.

The search list is currently limited to six domains with a total of 256 characters. If search 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.

By default, it search contains only the local domain name.

domain
Local domain name. You can use this instead of the search option to specify a single domain to check if a hostname isn't specified. Most people just use search instead (that option lets you use multiple servers, domain doesn't). You can't use domain and search at the same time - they're mutually exclusive.

If domain 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.

sortlist
Sorts addresses returned by the gethostbyname system call. 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 where option is one of the following:
debug
sets RES_DEBUG in Ft _res.options .
ndots: n
sets a threshold for the number of dots which must appear in a name given to Fn 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.
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 (see <resolv.h> ).
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 (see <resolv.h> ).
rotate
sets RES_ROTATE in Ft _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 Ft _res.options , which disables the modern BIND checking of incoming host names and mail names for invalid characters such as underscore (_), non-ASCII, or control characters.
inet6
sets RES_USE_INET6 in Ft _res.options . This has the effect of trying a AAAA query before an A query inside the Ft gethostbyname function, and of mapping IPv4 responses in IPv6 ``tunnelled form'' if no AAAA records are found but an A record set exists.
ip6-dotint / no-ip6-dotint
sets / clears the RES_NOIP6DOTINT bit in Ft _res.options , which when set (ip6-dotint) will enable reverse IPv6 lookups to be made in the (deprecated) ip6.int zone; when clear (no-ip6-dotint), reverse IPv6 lookups are made in the ip6.arpa zone by default.
ip6-bytestring
sets RES_USEBSTRING in Ft _res.options . This causes reverse IPv6 lookups to be made using the bit-label format of RFC 2673; if not set, then nibble format is used.

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 <resolv.h>  

SEE ALSO

gethostbyname(3), hostname(7), named(8), resolver(3), resolver(5). ``Name Server Operations Guide for BIND ''

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 15:39:42

fcloseall中文man

2011-08-25 15:00:15

cfgetispeed中文man

2011-08-19 18:35:50

issue中文man

2011-08-25 17:03:51

pclose中文man

2011-08-25 17:40:25

setvbuf中文man

2011-08-23 14:21:16

poweroff中文man

2011-08-24 15:52:59

intro中文man

2011-08-23 13:40:31

2011-08-25 15:54:08

ferror中文man

2011-08-25 17:24:54

puts中文man

2011-08-25 18:34:55

ungetc中文man

2011-08-23 10:03:40

useradd中文man

2011-08-23 10:29:02

chpasswd中文man

2011-08-23 10:34:22

convertquot中文man

2011-08-23 15:39:34

rpmbuild中文man

2011-08-24 15:48:38

INSERT中文man
点赞
收藏

51CTO技术栈公众号