大网数据广告活动
服务器运维问答

What happens when specifying multiple dns servers with DHCP Option 6?

· 52CE 我爱测

If I have the following DHCP option 6 (DNS), what happens? 6,1.1.1.1,8.8.8.8 Will 1.1.1.1 be served, and 8.8.8.8 as fallback if 1.1.1.1 fails? Extra context: I am running odhcpd on OpenWRT with pi-hole as my DNS server, and want …

问题原文

原帖链接 · drum · CC BY-SA 4.0

If I have the following DHCP option 6 (DNS), what happens?

6,1.1.1.1,8.8.8.8

Will 1.1.1.1 be served, and 8.8.8.8 as fallback if 1.1.1.1 fails?

Extra context: I am running odhcpd on OpenWRT with pi-hole as my DNS server, and want to have an automatic fallback in case the pi-hole fails.

已采纳解答

原帖链接 · Swisstone · CC BY-SA 4.0

RFC 2132 (DHCP Options and BOOTP Vendor Extensions), section 3.8 says:

The domain name server option specifies a list of Domain Name System [...] name servers available to the client. Servers SHOULD be listed in order of preference.

"Should", not "Must", so, it depends on the client...

For example, Windows tries the first one, and falls back to the others if needed:

You can specify multiple servers for DNS resolution. Their priority is determined by the order. If the first server isn't available to respond to a host name resolution request, the next DNS server in the list is accessed, and so on

Configuring TCP/IP networking

Same on Linux:

The algorithm used is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are made.

RESOLV.CONF(5)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-05-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。