Expected Behaviour:
Pi Hole should work and block websites for all clients.
I am using it on a Raspberry Pi 4 Model B with Raspbian, docker and docker-compose connected over LAN to a Fritz!Box router. My docker-compose.yml
looks as follows:
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
ports:
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp"
- "80:80/tcp"
- "443:443/tcp"
environment:
TZ: 'Europe/Berlin'
WEBPASSWORD: 'mypassword'
DNS1: 9.9.9.9
ServerIp: 192.168.178.50
volumes:
- '/opt/containers/pihole/pihole/:/etc/pihole/'
- '/opt/containers/pihole/dnsmasq/:/etc/dnsmasq.d/'
dns:
- 127.0.0.1
- 9.9.9.9
cap_add:
- NET_ADMIN
Tried it with IPv6 disabled and enabled. It is a fresh installation (of Raspbian and Docker).
I add the Pi-Hole IP address to my routers DNS settings (with another alternative DNS server).
In the Pi-Hole settings, I checked "Listen on all interfaces".
Actual Behaviour:
The DNS server doesn't work in the network, Pi-Hole can't resolve the URLs into IPs from any client in the same network.
The dashbord looks as follows:
It looks like Pi-Hole works only on the localhost machine. If I add the IP address of the Pi-Hole Raspberry server manually on a client in the same network, I can't load any website.
From a client, nslookup europa.eu 192.168.178.50
returns:
;; connection timed out; no servers could be reached
But ping 192.168.178.50
works fine and as you can see I can visit the admin dashboard as well.
On the same client, nslookup europa.eu 9.9.9.9
as well as using the router with nslookup europa.eu 192.168.178.1
(because it uses the alternative DNS server instead of Pi-Hole).
The result of sudo netstat -anlp | grep -w LISTEN
is:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 509/sshd
tcp6 0 0 :::80 :::* LISTEN 18662/docker-proxy
tcp6 0 0 :::53 :::* LISTEN 18690/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 509/sshd
tcp6 0 0 :::443 :::* LISTEN 18648/docker-proxy