Dhcp-option 6 with PiHole 6

Expected Behaviour:

I am running two instances of pihole on my network. One (PH1) is running as a container on my QNAP NAS and is serving addresses with DHCP, and the other one (PH2) is running as a container on my RaspberryPi 3 running HomeAssitant OS, configured to lookup local addresses on PH1.
My intention is to use PH2 as a backup for PH1, should anything happen to my QNAP NAS (or even while it's rebooting). To achieve this, before upgrading them both to PiHole 6, I had /etc/dnsmasq.d loaded as a volume on PH1, with a custom configuration to set both as the DNS servers served by PiHole's DHCP server:

dhcp-option=6,192.168.10.31,192.168.10.14

(10.31 is PH1, 10.14 is PH2)

Actual Behaviour:

After upgrading to PiHole 6 and the migration of the config, I can see that PH1 no longer serves PH2 as the secondary DNS server. I have read about this and it seems the /etc/dnsmasq.d is disabled by default.
While I know I can enable it (via misc.etc_dnsmasq_d), I was wondering if simply adding

dhcp-option=6,192.168.10.31,192.168.10.14

to misc.dnsmasq_lines would do the trick, and if so, should I then unmount and delete the /etc/dnsmasq.d volume?

Yes, adding that entry to misc.dnsmasq_lines should work, and you won't need the mounted volume then.

Both would work.
I'd probably prefer misc.dnsmasq_lines for just that one line.

If you are not using misc.etc_dnsmasq_d, then there would be no need to mount /etc/dnsmasq.d for your Pi-hole container.
You'll note that Pi-hole's sample configuration also does no longer mount it.

Yes, that was my deviation from the default configuration with PiHole 5, in order to retain the contents of /etc/dnsmasq.d between image upgrades.
That was a lesson learned after migrating from pihole installed on RaspberryPi OS which had no problem with upgrades, vs docker upgrades which reverted my changes /etc/dnsmasq.d.

I wanted to confirm that using dnsmasq_lines is indeed the preferred option rather than mounting /etc/dnsmasq.d

I can confirm that adding that line worked:

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . : lan
   Description . . . . . . . . . . . : Realtek RTL8852AE WiFi 6 802.11ax PCIe Adapter
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::e693:6580:dabf:ce9c%18(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.10.11(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Tuesday, 1 April 2025 07:56:59
   Lease Expires . . . . . . . . . . : Wednesday, 2 April 2025 07:56:59
   Default Gateway . . . . . . . . . : 192.168.10.1
   DHCP Server . . . . . . . . . . . : 192.168.10.31
   DHCPv6 IAID . . . . . . . . . . . : 267946450
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2E-FF-53-20-F8-89-D2-E5-89-C9
   DNS Servers . . . . . . . . . . . : 192.168.10.31
                                       192.168.10.14
   NetBIOS over Tcpip. . . . . . . . : Enabled

There is no "preferred" way to do it.
It is the user's choice.

We usually recommend using misc.dnsmasq_lines when there are just a few lines because the user can easily handle the changes via web interface, without the need to open text editors and change files on the server.

On the other hand, when the user wants to change many dnsmasq options, using many lines, we recommend to use an external file and enabling misc.etc_dnsmasq_d.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.