I'm running pi-hole using podman as a non-root user so I've mapped port 53001 on the Pi to the
pi-hole container's port 53.
I've then added the following iptables rule:
iptables -t nat -A PREROUTING -p udp --dport 53 \ --source 192.168.2.0/24 -j DNAT --to-destination 192.168.5.93:53001
This works great except all of the clients are logged as 'localhost' and if I look in the pihole log all DNS requests show 127.0.0.1 as the client.
Oct 16 09:43:20 dnsmasq: query[AAAA] discourse.pi-hole.net from 127.0.0.1
After some research I've tried adding:
iptables -t nat -A POSTROUTING -p udp --destination 192.168.5.93 --dport 53001 -j SNAT --to-source 192.168.5.93 iptables -t nat -A POSTROUTING -j MASQUERADE
But nothing seems to be able to show the original 192.168.2.XXX ip address on the pihole.
Is this possible? Could it because the client is on a different subnet ?