The original post: /r/pihole by /u/datawh0rder on 2024-10-28 22:53:53.

I’m running both Pihole and Wireguard in separate docker containers built from their own docker compose files. In the wireguard file I set the PEERDNS to the docker IP of Pihole, and everything works swimmingly on mobile and desktop. Everything except local DNS, that is. When I try to connect to my home network via VPN and then visit something like pihole.home/admin, the request hangs before failing. I looked through the pihole logs and it looks like what’s happening is it’s receiving a query for pihole.home from the IP address of the wireguard docker container, as opposed to the reserved IP i have for my phone on my home network at the router level (Pihole is not my DHCP). Pihole then tries to return 192.168… as the resolution for the hostname but that seems to be failing.

So. Why am I posting this here instead of r/wireguard or r/pihole? Because it seems like my main issue is this: One docker container A receives a request from the IP of another docker container B. A returns an IP resolution to B representing the IP of a device on the host LAN, but B seems unable to redirect to said IP. How do I get container B to also connect to the IP on the host LAN? Do I need to set network mode to host on B? Any tips or potential solutions here are appreciated.

When I’m actually on the LAN everything works perfectly, I’m assuming because the requests are going from device -> pihole directly, and the device knows to connect to a LAN IP because it’s being resolved through the router itself rather than a siloed container.

Thanks in advance.