What happens when specifying multiple dns servers with DHCP Option 6

dhcpdhcp-optiondomain-name-system

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.

Best Answer

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)