Mac: Unable to connect to pihole

Please follow the below template, it will help us to help you!

If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using nginx instead of lighttpd, or there is some other aspect of your install that is customised) - please use the Community Help category.

Expected Behaviour:

MacOS Studio 15.3.1

Expected to see pihole gui interface

Installed The official Pi-hole Docker image from pi-hole.net via docker desktop 4.37.1. For ports set 70,71,72,73.

Actual Behaviour:

when connect to ipaddress:70
Safari: "the server unexpectedly dropped the connection"
Chrome: "this page isn't working ... err empty response"
Firefox: "The connection to the server was reset while the page was loading."

Fing shows that the ports are in use
70 gopher
71 netrjs-1 Remote Job Service

Debug Token:

(https://tricorder.pi-hole.net/GokXTqza/)

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

docker exec -it <pihole-container-name-or-id> pihole -d

where you substitute <pihole-container-name-or-id> as required.


Also, include the compose file or docker run command used to start the container.

Didn't I already upload the log? The debug token in the original post did not work?

Got an error after running your command and saying yes to upload:

** The debug log can be uploaded to tricorder.pi-hole.net for sharing with developers only.*

[?] Would you like to upload the log? [y/N] y

    • Using curl for transmission.*
    • curl failed, contact Pi-hole support for assistance.*
    • Error message: curl: (22) The requested URL returned error: 400*

[✗] There was an error uploading your debug log.

    • Please try again or contact the Pi-hole team for assistance.*
    • A local copy of the debug log can be found at: /var/log/pihole/pihole_debug.log*

What's next:

  • Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug pihole*
  • Learn more at docker debug | Docker Docs*

Don't know how to upload to tricorder.pi-hole.net. Went to that webpage and it was blank.

Also, include the compose file or docker run command used to start the container.

I guess that is a YML file? Have no idea how to find it.

This is from the "copy docker run" in the containers section:

docker run --hostname=59fb53649f45 --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env=DNSMASQ_USER=pihole --env=FTL_CMD=no-daemon --network=bridge --workdir=/ -p 70:443 -p 71:53 -p 72:53/udp -p 73:67/udp --restart=no --label='org.opencontainers.image.created=2025-02-24T18:11:26.797Z' --label='org.opencontainers.image.description=Pi-hole in a docker container' --label='org.opencontainers.image.licenses=NOASSERTION' --label='org.opencontainers.image.revision=29b604af3f1e65523dbb0971749efed236e151fa' --label='org.opencontainers.image.source=https://github.com/pi-hole/docker-pi-hole' --label='org.opencontainers.image.title=docker-pi-hole' --label='org.opencontainers.image.url=https://github.com/pi-hole/docker-pi-hole' --label='org.opencontainers.image.version=2025.02.6' --runtime=runc -d pihole/pihole:latest

Spent a bit of time looking at similar posts. Some of the diagnostic things they mentioned:

strong text/ # sudo pihole-FTL --config webserver.port
80o,443os,[::]:80o,[::]:443os

/ # nslookup pihole
Server: 192.168.65.7
Address: 192.168.65.7#53

My network is 10.0.0.x so have no idea what this is referencing

Does Pihole running under docter run its own webserver?

Remapping ports 53 and 67 won't work, even less so if you do map them differently for UDP and TCP:
Clients will send their DNS requests to port 53, the standard port for DNS.
Also, they would broadcast for a DHCP server on port 67, the standard port for DHCP, but even with port 67, broadcasts would not reach your container, as Docker isolates that in a separate link when using bridge network modes (and anyway, you would only need port 67 if you intend to enable Pi-hole as DHCP server).

Thanks for the detailed explanation. So I put "0" for the 4 port values when setting it up. Now I get:

/ # sudo pihole-FTL --config webserver.port
80o,443os,[::]:80o,[::]:443os

/ # nslookup pihole
Server: 192.168.65.7
Address: 192.168.65.7#53

But where is the server?
sudo lsof -i -n -P | grep TCP doesn't show any of these ports being in use

docker exec -it pihole pihole -d

lists a bunch of IP addresses none of which are my normal local network 10.0.0.x:

**** [ DIAGNOSING ]: Network routing table*

  • default via 172.17.0.1 dev eth0 *
  • 172.17.0.0/16 dev eth0 scope link src 172.17.0.2 *
    **** [ DIAGNOSING ]: Networking*
    [i] Default IPv4 gateway(s):
  • 172.17.0.1%eth0*
    
    • Pinging first gateway 172.17.0.1...*
    • *** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain*

[✓] www.booking.extranemt-heosting.com is NOERROR on lo (127.0.0.1)

[✓] www.booking.extranemt-heosting.com is NOERROR on eth0 (172.17.0.2)

[✓] doubleclick.com is 142.250.189.174 via a remote, public DNS server (8.8.8.8)

**** [ DIAGNOSING ]: Discovering active DHCP servers (takes 6 seconds)*

  • Scanning all your interfaces for DHCP servers and IPv6 routers*
  • Timeout: 6 seconds*
  • Error while sending Router Solicitation on eth0: Network unreachable*
  • No answer on eth0*

hostsdir=/etc/pihole/hosts
no-resolv
port=53
server=8.8.8.8
server=8.8.4.4

-rw-rw---- 1 pihole pihole 53K Mar 1 22:09 /etc/pihole/pihole.toml
[dns]
upstreams = [
"8.8.8.8",
"8.8.4.4"

*** [ DIAGNOSING ]: contents of /etc

-rw-r--r-- 1 root root 222 Mar 1 22:09 /etc/resolv.conf
nameserver 192.168.65.7

So there are 7 IP addresses listed. What address do I use to access the pihole? With pihole installed in Container Station on my QNAP NAS I access it at http://10.0.0.70/admin/.

The Docker list of pihole ports makes it even more confusing:

You can't remap 53 and 67 to 0 either.

You have to publish and expose the same ports, e.g. 53:53/udp.

Thanks for your quick response. Tried

errored out

but pihole is my only container

and in macos terminal

sudo lsof -i -n -P | grep TCP

doesn't show that the port is in use.

Tried again this morning and the error went away and pihole started

/ #  sudo pihole-FTL --config webserver.port
80o,443os,[::]:80o,[::]:443os
 # nslookup pihole
Server:         192.168.65.7
Address:        192.168.65.7#53

** server can't find pihole: NXDOMAIN

unable to generate debug log:

/ # docker exec -it pihole  pihole -d
/bin/sh: docker: not found

Log file shows:

2025-03-02 14:48:25 2025-03-02 22:48:22.754 UTC [191M] INFO: Web server ports:
2025-03-02 14:48:25 2025-03-02 22:48:22.754 UTC [191M] INFO:   - 0.0.0.0:80 (HTTP, IPv4, optional)
2025-03-02 14:48:25 2025-03-02 22:48:22.754 UTC [191M] INFO:   - 0.0.0.0:443 (HTTPS, IPv4, optional)
2025-03-02 14:48:25 2025-03-02 22:48:22.754 UTC [191M] INFO:   - [::]:80 (HTTP, IPv6, optional)
2025-03-02 14:48:25 2025-03-02 22:48:22.754 UTC [191M] INFO:   - [::]:443 (HTTPS, IPv6, optional)

sudo lsof -i -n -P | grep TCP

doesn't show that the ports are in use

trying to connect to localhost:;80 "safari can't connect to the server localhost"
trying to connect to http://127.0.0.1:80 " can't connect www.127.0.0.1:80 because the page's address is invalid

netstat | grep 53
kctl 0 0 53 3 com.apple.net.netagent
kctl 0 0 53 7 com.apple.netsrc

That's the expected result, unless you'd have explicitly named your Pi-hole host pihole. pi.hole (note the dot) is the default name as provided by Pi-hole.

The machine that ran that command cannot find the docker executable.
Was that run from the machine hosting your Docker installation?

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