I've set up a Pi-Hole on a Ubuntu VM using Docker Compose and it's been working fine. However, I recently installed a few additional Docker containers, and I've noticed that these new containers can't access the internet. I'm starting to think that this might be related to Pi-Hole, but I'm not entirely sure. I've tried bringing down the Pi-Hole container, but the containers still lack connectivity. Meanwhile, the VM itself is able to connect to the internet without issues. Has anyone experienced something similar or have any ideas on what might be causing this?
3 Answers
I ran into a similar issue before. It turned out that my DNS server was configured to only allow recursive lookups from a local network, which blocked requests coming from the containers because they were hitting the DNS server from a different IP range. You might want to check the settings on your Pi-Hole to see if it’s set up that way. It can be a common setup to prevent DNS servers from being open to the public.
What’s the network setup for your containers? Are they all on the same Docker network? If you’re using a default network, the communication might be blocked. Check your Docker Compose file for the network settings to ensure they can see each other and can reach your DNS service on the host.
I’m using AdGuard instead of Pi-Hole, but I had to set my AdGuard container to use host networking. This allowed it to interact with all other containers directly. You might want to consider configuring your containers to use host networking or adjusting your network settings in Docker for them to communicate properly.
I’m using a basic Docker Compose setup with my configuration paths adjusted. I have a service defined for Dokuwiki and the Pi-Hole is set up using the default method too. I'll look into this network issue and see if I need to adjust anything.