Problem: After upgrading from v5 → v6, Local DNS doesn’t work with dns.listeningMode = local, but works with dns.listeningMode = all. The same config used to work with v5, with an older docker container.
Upgrade was done using:
docker compose down
docker compose pull
docker compose up -d
Expected Behaviour:
On the docker server:
~/pihole-docker $ nslookup switch.home
Server: 192.168.0.50
Address: 192.168.0.50#53
Name: switch.home
Address: 192.168.0.2
On a DNS client:
Som> nslookup switch.home
Server: pihole.home
Address: 192.168.0.50
Name: switch.home
Address: 192.168.0.2
Device and Env details attached at the end.
Actual Behaviour:
Nslookup fails both locally on the docker server and the clients (for DNS) when listening mode is set to local, probably due to the fact that docker doesn’t recognize the IP of the external network. Note: Docker isn’t on a bridged network as can be seen in the docker compose file below. Earlier on v5, this used to work.
On the docker server:
~/pihole-docker $ nslookup switch.home
Server: 8.8.8.8
Address: 8.8.8.8#53
** server can't find switch.home: NXDOMAIN
~/pihole-docker $ nslookup switch.home localhost #STILL WORKS
Server: localhost
Address: ::1#53
Name: switch.home
Address: 192.168.0.2
On a DNS client:
Som> nslookup switch.home
DNS request timed out.
timeout was 2 seconds.
Server: UnKnown
Address: 192.168.0.50
DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
*** Request to UnKnown timed-out
Device and Env Details:
OS Version:
~/pihole-docker $ cat /etc/os-rel*
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Hardware:
Raspberry Pi 4B
Docker Compose File:
~/pihole-docker $ cat docker-compose.yml
version: "3"
# 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
hostname: pihole.infra
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"
environment:
TZ: 'Asia/Kolkata'
# WEBPASSWORD: 'set a secure password here or it will be random'
# 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
Docker Engine Version:
~/pihole-docker $ docker version
Client: Docker Engine - Community
Version: 28.4.0
API version: 1.51
Go version: go1.24.7
Git commit: d8eb465
Built: Wed Sep 3 20:58:24 2025
OS/Arch: linux/arm
Context: default
Server: Docker Engine - Community
Engine:
Version: 28.4.0
API version: 1.51 (minimum version 1.24)
Go version: go1.24.7
Git commit: 249d679
Built: Wed Sep 3 20:58:24 2025
OS/Arch: linux/arm
Experimental: false
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0