8

I know it's possible to assign at least two DNS servers via DHCP. For example:

option domain-name-servers 8.8.8.8, 4.2.2.2;

But I wanted to know if I could also add a third DNS or if this would even make sense? My idea is to have a third DNS as a backup.

Can I do this or should I write my dhcpd.conf via a script that checks if the primary DNS are up.

Thanks!

cookM
  • 183
  • 1
  • 1
  • 3
  • 1
    Thanks. Didn't come here for the answer you wanted. I just needed to correct syntax for multiple DNS servers. Thanks for this! – Fiddy Bux Jan 25 '19 at 22:59

2 Answers2

7

The spec for option type 6 has variable length and can support more than two entries. The length field is 8 bits and represents the number of bytes. 256 / 4 = 64 IP's. Clearly this is well beyond the number that the client must recognize, but specifying 3 entries is likely supported by many clients. It certainly won't hurt anything. orst-case the client will ignore the third.

Whether it makes sense or not is a function of your own infrastructure and availability. A WAN site might have two redundant servers on site and a third remote, for example. There are a number of mechanisms to improve availability of DNS infrastructure, many of which don't require additional IP's to be configured on the client side (i.e. anycast, load balancers).

rnxrx
  • 8,103
  • 3
  • 20
  • 30
1

you can put in as many as you want. 2 is common, 3 is not unreasonable and also somewhat common. 4+ would be edging in to overkill.

longneck
  • 22,793
  • 4
  • 50
  • 84