在查询现有 A 记录时,我注意到 AAAA 记录的以下奇怪行为。我所说的基本域是指没有子域的域名。因此,当 A 记录存在且特定记录上不存在 AAAA 记录时,我会收到带有“无错误”的 DNS 响应,而不是收到预期的“名称错误”标志。
以下是示例:
查询支持 IPv6 的域:
nslookup -type=aaaa cisco.com Server: google-public-dns-a.google.com Address: 8.8.8.8 Non-authoritative answer: Name: cisco.com Address: 2001:420:1101:1::a
查询不支持 IPv6 的域:
nslookup -type=aaaa microsoft.com Server: google-public-dns-a.google.com Address: 8.8.8.8 Name: microsoft.com
我会期望:
nslookup -type=aaaa microsoft.com
Server: google-public-dns-a.google.com
Address: 8.8.8.8
*** google-public-dns-a.google.com can't find microsoft.com: Non-existent domain
然而,如果我尝试一个子域(例如 support.microsoft.com),结果将适用于 A 查询,并且 AAAA 将返回一个空结果:
nslookup -type=a support.microsoft.com
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
Name: e10315.g.akamaiedge.net
Address: 96.6.190.192
Aliases: support.microsoft.com
wildcard.support.microsoft.com.edgekey.net
AAA:
nslookup -type=aaaa support.microsoft.com
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
Non-authoritative answer:
Name: support.microsoft.com
我会期望:
nslookup -type=aaaa support.microsoft.com
Server: google-public-dns-a.google.com
Address: 8.8.8.8
*** google-public-dns-a.google.com can't find support.microsoft.com: Non-existent domain
然而,当我查询不存在的 A 和 AAAA 记录时,我得到了 AAAA 查询的正确答案......这是设计使然还是 DNS 服务器错误?我无法找到这种行为的原因:
nslookup -type=aaaa dontexist.microsoft.com
Server: google-public-dns-a.google.com
Address: 8.8.8.8
*** google-public-dns-a.google.com can't find dontexist.microsoft.com: Non-existent domain