解决方法
我将重用这里的例子
https://serverfault.com/questions/130608/when-is-a-secondary-nameserver-hit/130625#130625
基本上它取决于解析器的实现.一些解析器命中第一个服务器,其他解析器将从那些可用的服务器中随机选择一个服务器.为了解决这个问题,大多数DNS服务器会随机化回复的顺序.
如果您要求google.com,您会得到以下答案:
#dig NS google.com ;; QUESTION SECTION: ;google.com. IN NS ;; ANSWER SECTION: google.com. 297286 IN NS ns3.google.com. google.com. 297286 IN NS ns2.google.com. google.com. 297286 IN NS ns4.google.com. google.com. 297286 IN NS ns1.google.com. ;; ADDITIONAL SECTION: ns1.google.com. 297067 IN A 216.239.32.10 ns2.google.com. 297074 IN A 216.239.34.10 ns3.google.com. 297074 IN A 216.239.36.10 ns4.google.com. 297067 IN A 216.239.38.10
然后我们再做一次:
#dig NS google.com ;; QUESTION SECTION: ;google.com. IN NS ;; ANSWER SECTION: google.com. 297249 IN NS ns3.google.com. google.com. 297249 IN NS ns2.google.com. google.com. 297249 IN NS ns1.google.com. google.com. 297249 IN NS ns4.google.com. ;; ADDITIONAL SECTION: ns1.google.com. 297030 IN A 216.239.32.10 ns2.google.com. 297037 IN A 216.239.34.10 ns3.google.com. 297037 IN A 216.239.36.10 ns4.google.com. 297030 IN A 216.239.38.10