Windows客户端DNS工作原理

通常大家对Windows客户端DNS的配置存在多个误区。

 

误区一,配置1个内网DNS1个外网DNS。解析内网的时候用内网DNS,解析外网的时候用外网。

 

电脑怎么知道哪个是内网?哪个是外网?我们内部的DNS服务器里就有10+DNS区域。

 

误区二,第一个DNS服务器解析不到的地址,会继续找第二个DNS服务器查询。


话分两说,超时了查不到会找第二个DNS服务器的。但是返回确定结果查无此人的话,是不会继续查询的。需要注意,查不到也是查询结果。

 

误区三,服务器上同一个DNS区域中,有些域名解析成内部,剩余的想解析成外部地址,我就不填了。查不到会自动向公网转发

 

此误区是没有理解DNS解析原理造成的。权威DNS服务器查不到了,它是不会像任何其他DNS服务器再查询的。

 

误区四,每次查询都会从网卡属性中的第一个DNS服务器开始查。

 

此误区和通常第一个误区一起结合。以为先配置内网DNS服务器,就能确保内网地址都能解析了。但是谁也没法保证内网查询永远不会出现超时。当内网服务器出现超时无返回结果,它在客户端DNS列表中的查询顺序会降低。以后再查询的时候就不会先查它了。所以,你填的DNS列表中的顺序并没有太大意义,运行了一段时间后,他们的顺序也会变得不同。

 

 

 

 

Important note: the DNS servers list is kept in memory by the dnscache service. The next best server is determined based on a priority. All the servers start with the same priority and they are sorted for each adapter based on the precedence in which they were configured. Each time a server times-out its priority is reduced and when a server answers its priority is boosted (error conditions also modify the priority of a server). The next best server for an adapter is the one with the higher priority that is higher in the precedence list (if more than one server have the same priority then the next best is the one that is higher in the precedence list).

It is important to note that this prioritized list is kept across different queries; this means that the priorities are not reset after each query, but they are reused. The idea is that if a server timed-out a recent query then the next query will go to another server with a higher priority first. The effect of this is that the preferred DNS server might not be the first to get the next query if it recently timed-out.
These priorities are reset to the initial default values after an interval named ServerPriorityTimeLimit defined in registry. See http://support.microsoft.com/kb/320760 for more information about this value.

https://blogs.technet.microsoft.com/stdqry/2011/12/14/dns-clients-and-timeouts-part-2/

 

 

If at any point the resolver receives a negative response from a server, it removes every server on that adapter from consideration during this search. For example, if in step 2, the first server on Alternate Adapter A gave a negative response, the resolver would not send the query to any other server on the list for Alternate Adapter A.

 

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc961411(v=technet.10)

发布了56 篇原创文章 · 获赞 2 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/qishine/article/details/82909101