本文档介绍在 Windows DNS 客户端上配置一个或多个域名系统(DNS)服务器 IP 时存在的回退和超时行为。
适用于: 支持的 Windows 客户端版本原始 KB 数: 2834226
总结
有关详细信息,请参阅 转发器和条件转发器解析超时。
使用多个 DNS 服务器 IP 配置 DNS 客户端会增加 DNS 基础结构的容错能力。 如果唯一配置的 DNS 服务器、基础网络链接的故障或将给定客户端连接到 DNS 服务器的支持网络基础结构失败,则添加多个 DNS 服务器 IP 可以继续解析 DNS 名称。 此类名称故障可能会导致应用程序或组件挂起、资源中断等待直接或间接导致操作失败的依赖超时过期。
出于这些原因,建议使用多个 DNS 服务器配置任何 Windows 客户端,但请务必注意 Windows 客户端解析过程,因为它根据配置的 DNS 服务器数不同。
在 NIC 上配置单个 DNS 服务器时,DNS 客户端的默认行为是什么
| 时间(自开始以来的秒) | 操作 |
|---|---|
| 0 | 客户端查询 DNS 服务器 |
| 1 | 如果在 1 秒后未收到响应,客户端会再次查询 DNS 服务器 |
| 2 | 如果在 1 秒后未收到响应,客户端会再次查询 DNS 服务器 |
| 4 | 如果在 2 秒后未收到响应,客户端会再次查询 DNS 服务器 |
| 8 | 如果在 4 秒后未收到响应,客户端会再次查询 DNS 服务器 |
| 10 | 如果在 2 秒后未收到响应,客户端将停止查询 |
DNS 服务器的任何名称错误响应都将导致进程停止 - 如果响应为负,客户端不会重试。
在这种情况下,客户端在超时前五次尝试查询同一 DNS 服务器。
示例
配置了单个 DNS 服务器的 Windows DNS 客户端,查询 Microsoft.com
客户端上的 Ipconfig
IPv4 地址。 。 。 。 。 。 。 。 。 。 。 :10.0.0.31(首选) DNS 服务器。 。 。 。 。 。 。 。 。 。 。 : 10.0.0.1
网络跟踪输出
Time Time Offset TimeDelta Source Dest Details
6:23:33.8063812 0.0000000 0.0000000 10.0.0.31 10.0.0.1 DNS:QueryId = 0xA5B4, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:23:34.8026943 0.9963131 0.9963131 10.0.0.31 10.0.0.1 DNS:QueryId = 0xA5B4, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:23:35.8042696 1.9978884 1.0015753 10.0.0.31 10.0.0.1 DNS:QueryId = 0xA5B4, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:23:37.8184257 4.0120445 2.0141561 10.0.0.31 10.0.0.1 DNS:QueryId = 0xA5B4, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:23:41.8394589 8.0330777 4.0210332 10.0.0.31 10.0.0.1 DNS:QueryId = 0xA5B4, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
在 NIC 上配置两个 DNS 服务器时,DNS 客户端的默认行为是什么
| 时间(自开始以来的秒) | 操作 |
|---|---|
| 0 | 客户端查询列表的第一个 DNS 服务器 |
| 1 | 如果在 1 秒后未收到响应,客户端将查询列表的第二个 DNS 服务器 |
| 2 | 如果在再 1 秒后未收到响应,客户端会再次查询列表的第二个 DNS 服务器 |
| 4 | 如果在 2 秒后未收到任何响应,客户端会同时查询列表中的所有服务器 |
| 8 | 如果在 4 秒后未收到响应,客户端会同时查询列表中的所有服务器 |
| 10 | 如果在 2 秒后未收到响应,客户端将停止查询 |
任何 DNS 服务器的任何名称错误响应都将导致进程停止 - 如果响应为负,客户端不会重试下一个服务器。 仅当前一个服务器无法访问时,客户端才会尝试新服务器。
示例
配置了两个 DNS 服务器的 Windows DNS 客户端,用于查询 Microsoft.com
客户端上的 Ipconfig
IPv4 Address. . . . . . . . . . . : 10.0.0.31(Preferred)
DNS Servers . . . . . . . . . . . : 10.0.0.1
10.0.0.2
网络跟踪输出
Time Time Offset TimeDelta Source Dest Details
6:28:12.5060330 0.0000000 0.0000000 10.0.0.31 10.0.0.1 DNS:QueryId = 0x7B1C, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:28:13.5129164 1.0068834 1.0068834 10.0.0.31 10.0.0.2 DNS:QueryId = 0x7B1C, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:28:14.5124283 2.0063953 0.9995119 10.0.0.31 10.0.0.2 DNS:QueryId = 0x7B1C, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:28:16.5288823 4.0228493 2.0164540 10.0.0.31 10.0.0.1 DNS:QueryId = 0x7B1C, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:28:16.5289050 4.0228720 0.0000227 10.0.0.31 10.0.0.2 DNS:QueryId = 0x7B1C, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:28:20.5582196 8.0521866 4.0293146 10.0.0.31 10.0.0.1 DNS:QueryId = 0x7B1C, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
6:28:20.5582475 8.0522145 0.0000279 10.0.0.31 10.0.0.2 DNS:QueryId = 0x7B1C, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
在 NIC 上配置三个或多个 DNS 服务器时,DNS 客户端的默认行为是什么
使用了多少个超时值以及哪些超时?
| 时间(自开始以来的秒) | 操作 |
|---|---|
| 0 | 客户端查询列表的第一个 DNS 服务器 |
| 1 | 如果在 1 秒后未收到响应,客户端将查询列表的第二个 DNS 服务器 |
| 2 | 如果第 1 秒后未收到响应,客户端将查询列表的第三个 DNS 服务器 |
| 4 | 如果在 2 秒后未收到任何响应,客户端会同时查询列表中的所有服务器 |
| 8 | 如果在 4 秒后未收到任何响应,客户端会同时查询列表中的所有服务器 |
| 10 | 如果在 2 秒后未收到响应,客户端将停止查询 |
任何 DNS 服务器的任何名称错误响应都将导致进程停止 - 如果响应为负,客户端不会重试下一个服务器。 仅当前一个服务器无法访问时,客户端才会尝试新服务器。
如果唯一可访问的服务器位于 4 或更高位置,那么在实际尝试之前,在原始查询之后,预期延迟至少为 4 秒。 如果请求 DNS 解析的应用程序具有低于此值的应用程序解析超时,则可能会导致问题。 之前查询此服务器的唯一方法是将其设置为前三个位置。
示例
配置了五个 DNS 服务器的客户端,用于查询 Microsoft.com
客户端上的 Ipconfig
Pv4 Address. . . . . . . . . . . : 10.0.0.31(Preferred)
DNS Servers . . . . . . . . . . . : 10.0.0.1
10.0.0.2
10.0.0.3
10.0.0.4
10.0.0.5
网络跟踪输出
Time Time Offset TimeDelta Source Dest Details
9:50:19.4165728 0.0000000 0.0000000 10.0.0.31 10.0.0.1 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:20.4030068 0.9864340 0.9864340 10.0.0.31 10.0.0.2 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:21.4053190 1.9887462 1.0023122 10.0.0.31 10.0.0.3 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:23.4022371 3.9856643 1.9969181 10.0.0.31 10.0.0.1 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:23.4022575 3.9856847 0.0000204 10.0.0.31 10.0.0.2 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:23.4022646 3.9856918 0.0000071 10.0.0.31 10.0.0.3 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:23.4023130 3.9857402 0.0000484 10.0.0.31 10.0.0.4 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:23.4023347 3.9857619 0.0000217 10.0.0.31 10.0.0.5 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:27.4113578 7.9947850 4.0090231 10.0.0.31 10.0.0.1 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:27.4113788 7.9948060 0.0000210 10.0.0.31 10.0.0.2 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:27.4113860 7.9948132 0.0000072 10.0.0.31 10.0.0.3 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:27.4113932 7.9948204 0.0000072 10.0.0.31 10.0.0.4 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
9:50:27.4114034 7.9948306 0.0000102 10.0.0.31 10.0.0.5 DNS:QueryId = 0xE2A2, QUERY (Standard query), Query for microsoft.com of type Host Addr on class Internet
详细信息
如果客户端具有多个 NIC 处于活动状态,且其上配置了不同的 DNS 服务器,则客户端解析行为略有不同。
如果使用名称解析工具(如 nslookup),则客户端解析行为不同。