capture/forward all outbound DNS traffic
Go to solution
Solved by mikeyw64,
Success!!!
Found the “solution” at this page.
Forward the DNS traffic to my ISP provided router and it then bounces it back to PiHole.
pi@Heimdall:~ $ sudo iptables -t nat -A PREROUTING -i eth1 ! -s 192.168.1.2 -p tcp --dport 53 -j DNAT --to 192.168.1.1:53 pi@Heimdall:~ $ sudo iptables -t nat -A PREROUTING -i eth1 ! -s 192.168.1.2 -p udp --dport 53 -j DNAT --to 192.168.1.1:53 pi@Heimdall:~ $ sudo iptables -t nat -L --line-numbers Chain PREROUTING (policy ACCEPT) num target prot opt source destination 1 DNAT tcp -- !Heimdall anywhere tcp dpt:domain to:192.168.1.1:53 2 DNAT udp -- !Heimdall anywhere udp dpt:domain to:192.168.1.1:53 Chain INPUT (policy ACCEPT) num target prot opt source destination Chain POSTROUTING (policy ACCEPT) num target prot opt source destination 1 MASQUERADE all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) num target prot opt source destination
Top half below is the test results from my laptop configured statically as:
Static IP : 192.168.1.10
DNS : 192.168.1.2
DGW : 192.168.1.1
In the lower half the DGW was changed to 192.168.1.254 which is eth1 on the Pi, as you can see DNS requests to 8.8.8.8 now give the same response as going directly to the PiHole
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now