Pihole doesn't respond queries outside docker container on macos

I'm trying to use pihole from docker on my mac. The container runs fine and I can access the webconsole without any problem.

The issue is that when I change my mac dns to try to use the pihole it does not work, domains do not resolve.

But, if I enter on the container and do ping pi-hole.net it connects without issue and the query will appear on the console log.

I tried starting the container with different settings, but the behaviour is always the same. I've tried:

  • The repo script docker_run.sh
  • The docker-compose.yml example
  • Using docker run directly:
    docker run -d --name pihole -e INTERFACE=en0 -e ServerIP=192.168.1.39 -e TZ=Europe/Madrid -e WEBPASSWORD=somePassword -e DNS1=1.1.1.1 -e DNS2=1.0.0.1 -p 80:80 -p 53:53/tcp -p 53:53/udp -p 443:443 -v ~/pihole/:/etc/pihole/ --dns=127.0.0.1 --dns=1.1.1.1 --cap-add=NET_ADMIN --restart=unless-stopped pihole/pihole:latest
    (I added INTERFACE=en0 because by default it uses eth0 but I I do arp -a wifi interfece on my mac is en0. It does not work either way)

Expected Behaviour:

When changing computer dns ip to pihole (127.0.0.1 or local ip from other device) dns queries should be resolved and appear on the log.

Actual Behaviour:

I can access the console but only request made from inside the container are resolved.

Debug Token:

pvnenqm4zr

I guess I'm missing something here, but I can't tell what. I've been trying to make it work for a few days without any luck. I hope someone can help me.

docker ps
CONTAINER ID        IMAGE                  COMMAND             CREATED             STATUS                       PORTS                                                                                      NAMES
2129f760428b        pihole/pihole:latest   "/s6-init"          About an hour ago   Up About an hour (healthy)   0.0.0.0:53->53/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:53->53/udp, 67/udp   pihole

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.