目前,我正在尝试为虚拟SUSE主机配置内部企业域名设置,该操作系统是12 SP4。
SUSE主机需要解析两个域名:"infra.enterprise.com“和"test.infra.enterprise.com",并且这些SUSE主机的域名已正确设置为"infra.enterprise.com”。
域和记录都位于两个MS AD/DNS服务器(内部)上: 192.168.1.1为主服务器,192.168.1.2为次要服务器。
但是,我很困惑,应该在/etc/rupv.conf文件中添加哪些参数?
只要nameserver 192.168.1.1 192.168.1.2就行了,SUSE主机会自动解析这两个域吗?
还是我应该加上domain infra.enterprise.com?
search infra.enterprise.com test.infra.enterprise.com呢?
这会影响SUSE主机解决来自这两个域的所有FQDN吗?
发布于 2022-11-09 07:29:18
表格手册:
nameserver Name server IP address
Internet address of a name server that the resolver should
query, either an IPv4 address (in dot notation), or an
IPv6 address in colon (and possibly dot) notation as per
RFC 2373. Up to MAXNS (currently 3, see <resolv.h>) 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.)
search Search list for host-name lookup.
By default, the search list contains one entry, the local
domain name. It is determined from the local hostname
returned by gethostname(2); the local domain name is taken
to be everything after the first '.'. Finally, if the
hostname does not contain a '.', the root domain is
assumed as the local domain name.
This may be changed by listing the desired domain search
path following 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 available for one of the domains.
If there are multiple search directives, only the search
list from the last instance is used.
In glibc 2.25 and earlier, the search list is limited to
six domains with a total of 256 characters. Since glibc
2.26, the search list is unlimited.
The domain directive is an obsolete name for the search
directive that handles one search list entry only.因此,nameserver是服务器,通过解析器(如果提供的话)依次用于查询。搜索选项可以用于多个子域,但有一定的限制。
发布于 2022-11-09 09:27:04
nameserver只允许一个参数。
正确的做法是:
nameserver 192.168.1.1
nameserver 192.168.1.2这将允许您解析完全限定的域名。但是,仅这一点不允许您在没有FQDN的情况下解析简单的主机名。
例如,如果希望运行ping infra并希望它解析infra.example.com,则需要将其添加为搜索域。
search example.com这将允许您将infra解析为infra.example.com。
https://serverfault.com/questions/1115196
复制相似问题