resolv.conf名称服务器响应的顺序

时间:2018-07-03 03:03:30

标签: ubuntu dns bind nameservers dnsmasq

remove = TRUE进入URL时,出现了一个对话,其中有人声称从dig中选择NS的顺序是随机的,或者只是不确定的。

我很怀疑,所以进行了模拟。我启动了3个BIND9 Ubuntu 17框,并将它们映射到我的resolv.conf文件中的跳转框上:

resolv.conf

然后我从我的跳转框中进行挖掘: # resolv.conf on jumpbox nameserver 10.0.215.157 #dns1 nameserver 10.0.3.163 #dns2 nameserver 10.0.22.32 #dns3 ,我得到期望的答复:

dig www.amazon.com

我挖了几次,每次去#dns1 。我 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5308 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 13, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;amazon.com. IN A ;; ANSWER SECTION: amazon.com. 25 IN A 205.251.242.103 amazon.com. 25 IN A 176.32.98.166 amazon.com. 25 IN A 176.32.103.205 ;; AUTHORITY SECTION: . 86618 IN NS a.root-servers.net. . 86618 IN NS e.root-servers.net. . 86618 IN NS f.root-servers.net. . 86618 IN NS c.root-servers.net. . 86618 IN NS j.root-servers.net. . 86618 IN NS i.root-servers.net. . 86618 IN NS k.root-servers.net. . 86618 IN NS h.root-servers.net. . 86618 IN NS l.root-servers.net. . 86618 IN NS g.root-servers.net. . 86618 IN NS d.root-servers.net. . 86618 IN NS m.root-servers.net. . 86618 IN NS b.root-servers.net. ;; Query time: 0 msec ;; SERVER: 10.0.215.157#53(10.0.215.157) ;; WHEN: Mon Jul 02 21:44:07 EDT 2018 ;; MSG SIZE rcvd: 298 #dns1 上,并且按预期,我的查询由#dns2 处理。

我在{strong>#dns1 上systemctl stop bind9,而我的挖掘工作由 dns1 处理。

因此,我看到的每个步骤都是systemctl start bind9文件中列出的名称服务器的顺序是选择名称服务器时将其选择的顺序。

似乎可以通过手册页resolv.conf文件中的以下条目得到加强:

resolv.conf

有什么我想念的吗?在DNS方面,我不是专家,但努力查看我的逻辑可能存在的缺陷。

难道是systemd写入 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.) 文件的方式使其随机吗?

这是有关递归的自然改组行为的文章:https://github.com/systemd/systemd/issues/5755

选择递归实际上是Ubuntu> = 17的随机行为

0 个答案:

没有答案
相关问题