Please follow the below template, it will help us to help you!
Hi I am trying to make pihole container to listen only to a specific IP or interface
This is my configuration
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:
- "192.168.178.2:53:53/tcp"
- "192.168.178.2:53:53/udp"
#- "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
- "9080:80/tcp"
environment:
TZ: 'Europe/Zurich'
WEBPASSWORD: 'password'
INTERFACE: 'br0'
# Volumes store your data between container upgrades
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
#cap_add:
# - NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN)
restart: unless-stopped
Expected Behaviour:
When I start it with
docker compose start
I expect that it would listen only to the interface br0 or to listent only to the IP specified 192.168.178.2:53
Actual Behaviour:
instead it starts with 0.0.0.0 and I cannot anymore start another DNS at localhost:53
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 19330/docker-proxy
tcp 0 0 127.0.0.1:49449 127.0.0.1:953 TIME_WAIT -
udp 0 0 0.0.0.0:53 0.0.0.0:* 19351/docker-proxy
udp 0 0 0.0.0.0:5353 0.0.0.0:* 410/avahi-daemon: r
root@raspberrypi:~/pihole# ps -elf|grep docker-prox
4 S root 19330 990 0 80 0 - 179200 futex_ 23:30 ? 00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 53 -container-ip 172.22.0.2 -container-port 53
4 S root 19336 990 0 80 0 - 185923 futex_ 23:30 ? 00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 53 -container-ip 172.22.0.2 -container-port 53
4 S root 19351 990 0 80 0 - 185923 futex_ 23:30 ? 00:00:00 /usr/bin/docker-proxy -proto udp -host-ip 0.0.0.0 -host-port 53 -container-ip 172.22.0.2 -container-port 53
4 S root 19357 990 0 80 0 - 179200 futex_ 23:30 ? 00:00:00 /usr/bin/docker-proxy -proto udp -host-ip :: -host-port 53 -container-ip 172.22.0.2 -container-port 53