Wireguard and PiHole DNS

Hi I am a kind of noob to Docker and Linux … so forgive me please … :slight_smile:
I think this topic is discussed before so sorry for that

I have 2 Raspberry’s

  1. I installed on the host os Pi-Hole an WG works great (full vpn the client use the pi-hole DNS)
  2. an other Pi installed docker and 2 containers WG and Pi-hole

for the docker version inside the lan works great !
vpn is also running but not in combination with Pi-hole

the ip for the host system is 192.168.2.117.
docker Pi-hole >> docker ip 172.18.0.1 >> website 192.168.2.117:8080
docker WG >> 172.212.0.1

when I use DNS 192.168.2.117 no internet on mobile
when I use the default DNS 10.13.13.1 can pin local addresses on my lan and internet is working
but with free spam (Pi-hole is skipped)

is use linuxserver/wireguard is guess that is missed a routing between the 192.168.2.0 and the 10.13.13.0 network , which command (iptables) command do I need in the postup postdown (wg0.conf) ?

I have been testing a couple of hours but no success

thnx for reading !!

to clarify, you have 2 pihole instances, one installed properly on the host and one running in a container? the one running in the container is the one giving you issues?

not sorry…

Raspberry only docker installed …
2 containers

  1. WG
  2. Pi-hole

on lan PI-hole works… VPN is working also, can ping clients on the lan, but the DNS is not working via pi-hole. (no internet or working with spam )

we don’t support running your DNS in a container here because of issues like this. I would suggest installing pihole on bare metal of the pi and it will likely work for you (this is how i run things)

I think it must be possible (via an unsupported feature ) , with the postup and postdown script in WG
in theorie

  • set the dns for WG to the same pi hole address the same for the clients on the lan 192.168.2.117
  • make a route in the WG postup/down te create a routing between 192.168.2.0 and 10.13.13.0

but what will be the command for the postdown/up for the routing ?