pfsense + pi-hole + dns resolver (unbound) working with dns redirects.

Recently i switched my home network ad blocking software from dnsbl(pfblockerng) to pi-hole because the gui is so much nicer and easier to work with and see what all is going on. so when i changed my dns server in pfsense over to the new pi-hole server it basically bypassed all my dns redirects i had setup in unbound (dns resolver), so after some searching i found an option in unbound services>dns resolver “DNS query forwarding, check the box “enable forwarding mode” and that will make unbound the primary dns which retrieves its resolutions from pi-hole.

The downside to this setup is pi-hole shows all requests from 192.168.10.1 (aka my router) instead of the individual devices, but it was the only way to make it work with my lancache server which relies on the redirects from unbound.

hopefully i can tinker with it and find a workaround for that later but for now it works. Thanks for reading!

!

getting pi-hole to recognize individual clients behind a pfsense router

So, I installed pi-hole on a virtual machine at work, it worked great and a much better gui than pfblockerng/dnsbl but when I was looking at the list of clients the only thing showing was 192.168.0.1 which is my pfsense router,  that is strange right? well the reason that is happening is because I just added the IP for pi-hole under system > general settings > DNS server settings which worked but the problem is the DHCP server was still telling the clients to look at pfsense’s DNS resolver instead of pi-hole so all the requests were going through DNS resolver thus showing only one client in pi-hole since all the requests were coming from it.

what fixed the issue was going to system > DHCP server scroll down to “server list” and add the IP address of pi-hole and your secondary (probably your pfsense address so the requests go to DNS resolver) DNS servers and hit apply and that will make all clients show up in pi-hole’s client list.

one last thing to note, this process will make all machines on the network bypass your DNS resolver so any custom URL redirects on there will not work anymore maybe I will work on a way around that in the future, but for now you might be better off using pfblockerng/dnsbl inside pfsense unless you know a workaround if you do please share! thanks for reading and I hope this helped.

EDIT: i found a way to redirect dns requests via pi-hole here https://github.com/pi-hole/pi-hole/wiki/FAQs#can-i-redirect-a-domain-to-a-different-domain-333