Option to have secondary DNS in Dnsmasq when running two Piholes

I run two Pihole servers and I know a lot of other people do too, When I set one Pihole as a DHCP server dnsmasq has an option to hand out not only it's own IP but more than one DNS server IP.

When I set:

dhcp-option=6, 192.168.200.10, 192.168.200.11

in:

/etc/dnsmasq.d/02-pihole-dhcp.conf

It works fine until an update happens then I have to set it again, It would be nice to have this in the web gui.

In the code above My Pihole DHCP/DNS server is 192.168.200.11 and 192.168.200.10 is my other Pihole.

As a workaround for when (if) this feature is implemented, you could try adding that line to a separate config file in /etc/dnsmasq.d, as dnsmasq will read from everything in there. For example: /etc/dnsmasq.d/02-pihole-dhcp-DNS.conf. That file won't be touched on an update

I thought I would post how my router deals DHCP option's and possibly give the developers of Pihoe some idea's of how to impliment it.
This is a screenshot from LEDE 17.01.3

Although my my request is only for one option LEDE goes one step more offering all
" dhcp-option=?, options"

If your interested in better firmware running newer Linux kernels (2017) for your router check out https://lede-project.org/start

I believe this is implemented now with the ability to add custom upstream DNS servers.

48

No unfortunately that is not the solution, I wish it was that easy.

If you implement what I suggested it actually tells the computer that is getting DHCP from pihole that there are 2 DNS servers and the setting's sticks with that device until the DHCP request lease times out.

On Windows if you open a command prompt and type " ipconfig /all " you will see both DNS servers in the results.

Your way if the DHCP server dies you will loose all connectivity, Your way if you type " ipconfig /all " you will only see one pihole as the DNS server.

My apologies. In the meantime, @PromoFaux's workaround should work for now.

Do please watch your tone, this is a friendly happy place!