I have setup pihole as a docker container in portainer on a server in my local network and it provides DNS and DHCP on my local network. DHCP is working perfectly. I tried setting up a test for the DNS by adding the entry blah.blah and the IP 192.168.0.2 (the IP of the docker host where Pihole is running) in the DNS records of the pihole UI but when I try to access pihole from another host in the network using blah.blah/admin/index.php it does not resolve and instead just goes to a google search.
If I enter the ip address directly in the browser 192.168..0.2/admin/index.php I get to the pihole login screen and it works as expected. I tried nslookup blah.blah on this host and it returns what I believe it should:
Please post your compose file or docker run command used to start the container.
Also, 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:
pihole -d
or do it through the Web interface (Pi-hole v5 only): Tools > Generate Debug Log
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
# For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
#ports:
# - "53:53/tcp"
# - "53:53/udp"
# - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
# - "80:80/tcp"
# - "7300:80/tcp" # Web UI HTTP
network_mode: host
environment:
TZ: 'Europe/Prague'
WEBPASSWORD: 'xxxxxx'
# Volumes store your data between container upgrades
volumes:
- '/home/tony/Docker/pihole/etc-pihole:/etc/pihole'
- '/home/tony/Docker/pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
restart: unless-stopped
Sorry not sure what you mean by 'client' machine in this context. The nslookup output I posted was from a laptop on my home lan. If I run it from the docker host it's as follows:
Just realised from the debug log that CNAMES were set - deleted those and my duckdns.org domain has started resolving locally but not the blah.blah domain that points to the docker host. I suspect there is something specific about the config on the host that is broken.