Windows操作系统DNS工作原理

  在使用Windows操作系统,DNS服务器配置我们常范的错误。

  错误一:配置1个内网DNS,1个外网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/

 

  以下是翻译内容:

  重要提示:DNS服务器列表由dnscache服务保存在内存中。根据优先级确定下一个最佳服务器。所有服务器都以相同的优先级开始,并根据配置它们的优先级对每个适配器进行排序。每次服务器超时时,其优先级都会降低,当服务器应答时,其优先级会提高(错误条件也会修改服务器的优先级)。适配器的次优服务器是优先级列表中优先级较高的服务器(如果多个服务器具有相同的优先级,则次优服务器是优先级列表中优先级较高的服务器)。

  需要注意的是,这个按优先级排序的列表是跨不同的查询保存的;这意味着在每个查询之后不会重置优先级,而是重用优先级。其思想是,如果一个服务器对最近的查询超时,那么下一个查询将首先转到另一个具有更高优先级的服务器。这样做的结果是,如果首选DNS服务器最近超时,它可能不是第一个获取下一个查询的服务器。在注册表中定义的名为ServerPriorityTimeLimit的间隔之后,优先级将重置为初始默认值。

  

posted @ 2021-01-12 12:14  PBDragon  阅读(776)  评论(0编辑  收藏  举报