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
docker Pi-hole >> docker ip >> website
docker WG >>

when I use DNS no internet on mobile
when I use the default DNS 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 and the 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
  • make a route in the WG postup/down te create a routing between and

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