domain-name-system – 是否同时包含A记录和NS记录的子域?

前端之家收集整理的这篇文章主要介绍了domain-name-system – 是否同时包含A记录和NS记录的子域?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
假设我拥有example.com.

然后我在test.example.com上创建一条A记录到1.1.1.1.

然后我在test.example.com上创建一条NS记录到ns1.anotherdnshost.com.

在另一个DNS主机上,我将根(test.example.com)的A记录添加到2.2.2.2.

当客户端查询test.example.com时,将返回哪条A记录?哪个更具“优势”A记录?这样的设置有效吗?

解决方法

这是无效的,不是.它可能会返回1.1.1.1,因为它会被解析的第一个服务器返回,但“正确”值应该是SOA记录注册为主服务器的名称服务器.但是,返回的内容可能取决于运行哪个版本的nameserver软件.如下所示,它只是将它转发到下一个名称服务器,1.1.1.1将永远不会显示.

现在列出区域中的其他NS记录是正确的,但另一个NS应该是具有相同区域的名称服务器.但是,您可以将子域指向备用名称服务器.

因此,您的注册商的example.com指向ns1.example.com和ns2.example.com,其中1.2.3.4和2.3.4.5来自注册名称服务器(胶水).

然后,您将有一个SOA选择ns1或ns2作为主要区域的区域,然后您将有两个NS记录指向ns1.example.com和ns2.example.com,其中包含该域的A记录(以及mx,txt),cname等).

NS1和NS2.example.com都应该具有相同的区域,并且它们应该自动复制到彼此.

现在它是有效的,采取test.example.com并指向ns1.somethingelse.com和ns2.somethingelse.com但在ns1和ns2.example.com的名称服务器上的test.example.com没有记录,除了ns1和如果有粘连,ns2.example.com应自动发送ns1和ns2.somethingelse.com的IP. (如果TLD不同,即.com和.org不会)

我希望一切都有意义,如果有任何混淆,我可以澄清更多.

这是对发生的事情的测试:

在shadowrpg.net的名称服务器上:

$ttl 38400
@   IN  SOA shell2.reganw.com. root.shell2.reganw.com. (
            1298345653
            10800
            3600
            604800
            38400 )
@   IN  NS  shell2.reganw.com.
test.shadowrpg.net.     IN  A   127.0.0.1
test.shadowrpg.net. IN  NS  saber.reganw.com.

在test.shadowrpg.net的名称服务器(saber):

$ttl 38400
@   IN  SOA saber.reganw.com. root.shell2.reganw.com. (
            1298345653
            10800
            3600
            604800
            38400 )
@   IN  NS  saber.reganw.com.
test.shadowrpg.net.     IN  A   127.0.0.2
test.shadowrpg.net. IN  NS  saber.reganw.com.

第一个结果是未配置军刀,以显示推荐.

[regan@gamma ~]$dig +trace test.shadowrpg.net

; <<>> DiG 9.7.3-P1-RedHat-9.7.3-2.P1.fc13 <<>> +trace test.shadowrpg.net
;; global options: +cmd
.           518400  IN  NS  G.ROOT-SERVERS.NET.
.           518400  IN  NS  C.ROOT-SERVERS.NET. (snip)
;; Received 512 bytes from 127.0.0.1#53(127.0.0.1) in 2 ms

net.            172800  IN  NS  a.gtld-servers.net.
net.            172800  IN  NS  m.gtld-servers.net. (snip)
;; Received 493 bytes from 199.7.83.42#53(199.7.83.42) in 55 ms

shadowrpg.net.      172800  IN  NS  ns1.reganw.com.
shadowrpg.net.      172800  IN  NS  ns2.reganw.com.
shadowrpg.net.      172800  IN  NS  ns3.reganw.com.
;; Received 232 bytes from 192.35.51.30#53(192.35.51.30) in 54 ms

test.shadowrpg.net. 38400   IN  NS  saber.reganw.com.
;; Received 110 bytes from 209.161.6.3#53(209.161.6.3) in 2123 ms

test.shadowrpg.net. 38400   IN  NS  saber.reganw.com.
;; BAD (HORIZONTAL) REFERRAL
;; Received 110 bytes from 173.45.238.245#53(173.45.238.245) in 81 ms

test.shadowrpg.net. 38400   IN  NS  saber.reganw.com.
;; BAD (HORIZONTAL) REFERRAL
;; Received 110 bytes from 173.45.238.245#53(173.45.238.245) in 82 ms

test.shadowrpg.net. 38400   IN  NS  saber.reganw.com.
;; BAD (HORIZONTAL) REFERRAL
;; Received 110 bytes from 173.45.238.245#53(173.45.238.245) in 112 ms

并配有军刀:

^C[regan@gamma ~]$dig +trace test.shadowrpg.net

; <<>> DiG 9.7.3-P1-RedHat-9.7.3-2.P1.fc13 <<>> +trace test.shadowrpg.net
;; global options: +cmd
.           518400  IN  NS  L.ROOT-SERVERS.NET.
.           518400  IN  NS  J.ROOT-SERVERS.NET. (snip)
;; Received 512 bytes from 127.0.0.1#53(127.0.0.1) in 2 ms

net.            172800  IN  NS  m.gtld-servers.net.
net.            172800  IN  NS  a.gtld-servers.net. (snip)
;; Received 493 bytes from 198.41.0.4#53(198.41.0.4) in 129 ms

shadowrpg.net.      172800  IN  NS  ns1.reganw.com.
shadowrpg.net.      172800  IN  NS  ns2.reganw.com.
shadowrpg.net.      172800  IN  NS  ns3.reganw.com.
;; Received 232 bytes from 192.12.94.30#53(192.12.94.30) in 165 ms

test.shadowrpg.net. 38400   IN  NS  saber.reganw.com.
;; Received 110 bytes from 209.161.6.3#53(209.161.6.3) in 38 ms

test.shadowrpg.net. 38400   IN  A   127.0.0.2
test.shadowrpg.net. 38400   IN  NS  saber.reganw.com.
;; Received 126 bytes from 173.45.238.245#53(173.45.238.245) in 80 ms

[regan@gamma ~]$

因此,一旦添加了NS记录,它就会引用它,并且它会忽略对自身的任何查询.现在,如果为名称服务器添加A记录,它将以NS记录作为粘合剂传递(因此解析器不必查找新名称服务器的IP).

猜你在找的HTML相关文章