Pfsense, Pi-Hole, Redirect only 1 VLAN DNS to Pi-Hole with KeepAlived IP
I'm almost there with this but I can't seem to figure out how to redirect DNS to Pi-hole when a client forces a custom DNS like 8.8.8.8 or 1.1.1.1. I only want to filter clients who connect to IOT VLAN
`Main networks:` `WAN - DHCP` `LAN - 192.168.1.0/24 -- No DNS filtering by pi-hole, no blocked ports, where trusted devices and servers live (aka pi-hole, NAS, etc).`
`VLAN_WORK - 192.168.100.0/24 -- No DNS filtering by pi-hole, no blocked ports, blocked from other VLANs, should go straight out to internet like it was directly connected.`
`VLAN_IOT - 192.168.107.0/24 -- DNS should always be filtered by pi-hole, blocked from other VLANs with some exceptions to specific IP and Ports on LAN for pass-thru traffic where needed.`
`Pi-hole's connected to LAN` `192.168.1.32` `192.168.1.33`
`KeepAlived Virtual IP - 192.168.1.35`
DHCP is setup on every interface. Only on VLAN\_IOT do I force DNS to 192.168.1.35
There's a few other VLANs that I have setup but don't currently use.

\-

\-

\-

\-

`NAT Reflect Rule Options:` `Interface: VLAN_IOT` `Source: VLAN_IOT Subnets` `Destination: VLAN_IOT address` `Destination port range: DNS` `Redirect target IP: 192.168.1.35` `Redirect target port: DNS` `NAT reflection: Disable`
I've played around with this rule a ton, changing NAT reflection to it's different options, changing Source to \*. It either doesn't work or seems to cause issues on other VLANs for some reason. But glad to revisit if something is off.

\-


\- If a device on IOT\_VLAN get's DHCP, they connect and see the Pi-hole just fine. If I force them to have a DNS, 8.8.8.8 it just by passes the Pi-Hole.


\-

\-

Sometimes I'll see a block here, like you can see above. If I load up the same adtest, everything gets through or most does, refresh the page and then it all will.
I can swap DHCP vs 8.8.8.8 and flush the dns to go back and forth without a reboot and it behaves the same. DHCP always blocks no matter how much I refresh, forced DNS will sometimes on first loading a page block something but after browsing or a refresh nothing is blocked.
Testing using Windows 10 and edge in both regular and incognito mode.
I also tried to take KeepAlived out of the mix and changed the firewall to point to only a single Pi-Hole and that did not seem to make a difference so I put everything back since I would like to be able to have failover on them.
Also confirmed nothing is going to the failover Pi-Hole query logs and they are staying on the master.

If I check the states for the NAT Rule it looks like it is working?