Pihole running in Docker on NAS but nothing going through it

Can someone tell me where I have gone wrong?
_pihole_logs.txt (4.3 KB)

I have Pihole running on my QNAP NAS. I created the container in Container Station using the "quick start" Docker compose instructions here.

I had to set the ports as follows otherwise the container would fail to start due to port conflicts.

version: "3"

container_name: pihole
image: pihole/pihole:latest
- "8053:53/tcp"
- "8053:53/udp"
- "8080:80/tcp"
TZ: 'my local time'
WEBPASSWORD: 'my password'
- '/share/Container/AppData/Pihole/pihole:/etc/pihole'
- '/share/Container/AppData/Pihole/dnsmasq.d:/etc/dnsmasq.d'
restart: always

Here's the created container view in Portainer:

I can log in to the Web UI via just fine. The settings are all default and everything looks okay.

I've pointed my Asus router's DNS server settings to my NAS's static IP but nothing goes through it. Google is my DNS backup currently as without it, no pages will load.

You changed the DNS port to 8053:

    - "8053:53/tcp"
    - "8053:53/udp"

But your devices will send DNS queries to port 53.

You need to set port 53 on your compose file.
Also, if you have something else using this port on the host (you probably do), you will need to disable it.

Thank you for the tip.

Based on the comments in this thread, I've disconnected the Pihole container from the default "bridge" to QNAP's "QNET" which gives the container its own IP address and MAC address and avoids the port 53 conflict.

In my router's settings, I set the DNS server to this new IP and bingo, it works!

Do you know how I can set a static IP for Pihole running on this QNET network? The MAC address and IP address keep changing each time I restart the container.

I never used qnap NAS, but I think this "qnet" network mode is equivalent to macvlan.
If this is the case, you can use this mac address in your router to reserve an IP.

Okay so I finally got it all working properly. QNAP has some funny things going on under the hood I tell you.

The default QNET network in the screenshot above looks like some kind of DHCP network (you can see in the network name). I should have noticed as the IP address of Pihole kept changing every time I restarted the container. There was no way to set it static.

I then tried to manually create both a Macvlan and QNET network but they both either failed to start or I could not attach the Pihole container to them.

Then I randomly opened QNAP Container Station to do some other things and noticed in the "app template" menu the very first listed "QNAP-approved" app is Pihole!

I deployed this template and it automatically created its own QNET network where you can set a static IP. I set mine to be outside the range of my router's DHCP ( which seems to be all you need to do. You can't reserve an IP in your router anyway as the MAC address changes each time the container is restarted. The IP address persists thankfully which is the main thing.

As normal I then set my router's WAN DNS server to be Pihole's static IP and it's working!

Hope this all made sense and can help someone else out in the future using QNAP. What a nightmare.

I could have saved myself so much trouble by looking in QNAP's Container Station first but I don't see any reason why you can't set it all up yourself using Docker compose.

As I said, I don't use qnap, but I think you can set a "static" mac address when you create the container, using --mac-address=xx:xx:xx:xx:xx:xx (docker run command) or mac-address: xx:xx:xx:xx:xx:xx (in a compose file).