Pi-hole on docker cannot resolve pi.hole

I followed the docker github page and set up a pi-hole instance on my docker on Windows. I can access pi-hole admin page with 127.0.0.1:80, and I have verified that pi-hole is my DNS server. However, I could not access the admin page using pi.hole

I have set the --hostname docker parameter and the virtual_host environment variable.

Expected Behaviour:

Accessing http://pi.hole on my machine should load the pi-hole admin page.

Actual Behaviour:

Unable to resolve the name.

Debug Token:

https://tricorder.pi-hole.net/5qlwk7xgx3

It would seem you've explicitly configured pi.hole to be associated with 0.0.0.0:

*** [ DIAGNOSING ]: contents of /etc/pihole

-rw-r--r-- 1 root root 32 Nov  1 14:51 /etc/pihole/local.list
   0.0.0.0 pi.hole
   0.0.0.0 pi.hole

Additionally, run the following from a client in your network to confirm whether Pi-hole is indeed used as DNS server:

nslookup pi.hole
nslookup pi.hole
Server:  localhost
Address:  ::1

Name:    pi.hole
Address:  172.17.0.3

Looks like the address is resolved to the docker internal address...how to fix this?

Did you run that command from a client as asked or from your Pi-hole machine?

Yeah, I ran it on the machine with my docker and the pihole container.

Well, setting ServerIP environment variable to localhost solves my problem. Thanks!

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