Redirecting all DNS to pihole does not work :(
-
SETUP : I have only have a LAN and WAN on pfSense with the Lan being a 192.168.86.0/24. I have a pihole running, pfSense system DNS is set to pihole and DNS Resolver is running in forwarding mode.
I want to block ANY and ALL external DNS queries and redirect them to the pihole. To this effect I have define the rules as show here : https://labzilla.io/blog/force-dns-pihole
ISSUE : I test this thus (as mentioned in the article). Add a temporary DNS in the pihole for a random domain, set the host pc DNS to 1.1.1.1 and then issue a nslookup. The problem is when I set my DNS to 1.1.1.1 anywhere, for e.g. my laptop all DNS resolution is blocked and absolutely nothing resolves even internet domains. I understand that the redirection to pihole is working. Why am I not getting a response ? What did I not do right ?
-
@abesh well for starters that port forward on wan isn't going to do anything.. There should be a rule on your lan that allows pihole to forward to where you want.
lets see your lan firewall rules.
-
@johnpoz Awesome catch thank you ! I just changed that to LAN. No dice :( Pihole forwards to unbound running on localhost#5335 and that works since other DNS resolutions are working.
Firewall rules :
-
Hint : rules are handled from top to bottom.
Not 'all at one' or 'randomly'.So the very first rule (not counting the Anti-Lockout rule), a catch all IPv4 rule, will match all traffic, and is wide open for everything, TCP, UDP, ICMP etc for all destinations.
So this rule is used by all the traffic, and you can see it :
You see the states and packet counters ?
These two rules
never matched any traffic.
The first : you have no IPv6.
The second .... well, you understand by now ^^ -
@abesh said in Redirecting all DNS to pihole does not work :(:
I just changed that to LAN
because its not a suppose to be a port foward, and has @Gertjan has gone over already your lan rules are not correct for what your wanting to do.
-
@Gertjan said in Redirecting all DNS to pihole does not work :(:
Hint : rules are handled from top to bottom.
Not 'all at one' or 'randomly'.THANK YOU SO MUCH ! This is exactly what I was missing that was not making any sense. Now I understand it much better. Does the rule processing stop once it reaches a matching rule or does it continue post that as well ? That being said, in my scenario, how would I go about achieving what I want to do ?
-
-
One of mine interface rules:
The NAT rule:
But my upstream DNS is pfsense in the pi-hole settings.
-
@MoonKnight Thank you ! How would I adopt this to my situation. I have tried a few times and have managed to block DNS traffic from the pihole itself :(
This is what I have currently:
-
I have pfsense to use external DNS server and i'm running unbound in resolver mode.
DNS Resolver: