Pihole not resolving DNS in docker container

Hello,

I try setting up pihole in a docker container after updating to the new raspbian version on my raspberrypi.

I run pihole with this command:

docker run -d \
	--name pihole_container \
	--dns=127.0.0.1 \
	--dns=1.1.1.1 \
	-p 53:53 \
	-p 80:80/tcp \
	--restart=unless-stopped \
	-e TZ=DE \
	-e DNS1=1.1.1.1 \
	-e DNS2=1.0.0.1 \
	-e VIRTUAL_HOST=raspberrypi \
	pihole/pihole

Everythings seems to start normally but I cannot resolve any DNS queries from my PC in the same network:

dig google.de @192.168.0.10

; <<>> DiG 9.11.5-P1-1ubuntu2.5-Ubuntu <<>> google.de @192.168.0.10
;; global options: +cmd
;; connection timed out; no servers could be reached

where 192.168.0.10 is my pi's ip address.
However I can access the webinterface from the same pc.
Inside the container resolving DNS names works fine.

I have already tried to check the "Listen on all interfaces, permit all origins" option.

Any ideas?

If the Pi-hole does not have queries in the query log, then it never received them. Check that the docker container has the ports forwarded correctly and the networking set up so it can receive DNS requests.

Indeed are no queries inside the log.
I use the default bridge network and forwarded the ports 53 and 80 (as you can see in my first post).
Do I have to do anything besides that?

If there are no queries in the log, then something is not set up correctly to allow queries to go to Pi-hole. Maybe @diginc will have some ideas, as this sounds like a Docker networking issue.

You don't seem to have UDP port 53, check the default docker run example and confirm sure your ports match.

3 Likes

Oh my bad,

I thought -p 53:53 would open TCP and UDP port.

It works now.
Thank you very much.