Docker instance not resolving on local records

Hello, thanks a lot for your help in advance and for your involvement in this project in general.

The issue I am facing:

I have 2 instances of Pi-Hole, one dockerized and the other on a Raspberry, and the docker one cannot resolve local records (general DNS resolution works fine).

Details about my system:

192.168.1.24 is my raspberry pi instance, 192.168.1.251 is my docker instance.

I can get the raspberry pi instance to resolve local records, but not the docker one:

dig pi.hole @192.168.1.251

; <<>> DiG 9.10.6 <<>> pi.hole @192.168.1.251
;; global options: +cmd
;; connection timed out; no servers could be reached
dig pi.hole @192.168.1.24

; <<>> DiG 9.10.6 <<>> pi.hole @192.168.1.24
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13425
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; OPT=15: 00 1d 73 79 6e 74 68 65 73 69 7a 65 64 ("..synthesized")
;; QUESTION SECTION:
;pi.hole.			IN	A

;; ANSWER SECTION:
pi.hole.		0	IN	A	192.168.1.24

;; Query time: 1 msec
;; SERVER: 192.168.1.24#53(192.168.1.24)
;; WHEN: Wed May 06 14:29:37 CEST 2026
;; MSG SIZE  rcvd: 69

However, generic resolution works fine with the docker instance:

dig google.com

; <<>> DiG 9.10.6 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39296
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.			IN	A

;; ANSWER SECTION:
google.com.		281	IN	A	74.125.29.113
google.com.		281	IN	A	74.125.29.139
google.com.		281	IN	A	74.125.29.102
google.com.		281	IN	A	74.125.29.100
google.com.		281	IN	A	74.125.29.138
google.com.		281	IN	A	74.125.29.101

;; Query time: 9 msec
;; SERVER: 192.168.1.251#53(192.168.1.251)
;; WHEN: Wed May 06 14:30:27 CEST 2026
;; MSG SIZE  rcvd: 135

I know the docker instance runs in a subnet so I set up dns.listeningMode to ALL, but I still can't get any local record to resolve. Please note that if I setup dns.listeningMode to LOCAL then it's the same behavior but I get an explicit error in Pi-hole diagnosis. With ALL, no error at all on pi-hole's side.

What I have changed since installing Pi-hole:

Here is my compose.yaml file:

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      # DNS Ports
      - "53:53/tcp"
      - "53:53/udp"
      # Default HTTP Port
      - "8000:80/tcp"
      # Default HTTPs Port. FTL will generate a self-signed certificate
      - "4430:443/tcp"
      # Uncomment the below if using Pi-hole as your DHCP Server
      - "67:67/udp"
      # Uncomment the line below if you are using Pi-hole as your NTP server
      #- "123:123/udp"
    environment:
      # Set the appropriate timezone for your location from
      # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, e.g:
      TZ: 'Europe/Zurich'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'redacted'
      # If using Docker's default `bridge` network setting the dns listening mode should be set to 'ALL'
      #FTLCONF_dns_listeningMode: 'ALL'
    # Volumes store your data between container upgrades
    volumes:
      # For persisting Pi-hole's databases and common configuration file
      - './etc-pihole:/etc/pihole'
      # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'
      #- './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      # See https://docs.pi-hole.net/docker/configuration/#note-on-capabilities
      # Required if you are using Pi-hole as your DHCP server, else not needed
      - NET_ADMIN
      # Required if you are using Pi-hole as your NTP client to be able to set the host's system time
      - SYS_TIME
      # Optional, if Pi-hole should get some more processing time
      - SYS_NICE
    restart: unless-stopped

Aside from that, the only relevant setting I changed (that I'm aware of) is dns.listeningMode (it's commentated in the compose.yaml file because I wanted to test how other option behaved.

I'm a bit lost (it might be possible it has to do with why I'm unable to use my docker instance as DHCP server), I'd really appreciate any help. Thanks again in advance!

Please 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:

docker exec -it <pihole-container-name-or-id> pihole -d

where you substitute <pihole-container-name-or-id> as required.

here it is:

https://tricorder.pi-hole.net/CFFJtbTT/

Please post the output of these commands (executed from a different machine than the docker host):

dig google.com @192.168.1.251

dig pihole.home @192.168.1.251

If none of the commands result in a query, then this is a network issue (maybe a firewall).

Do you see something on the Pi-hole Query Log page?

Please post the output of these commands (executed from a different machine than the docker host):

dig google.com @192.168.1.251

; <<>> DiG 9.10.6 <<>> google.com @192.168.1.251
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47638
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.			IN	A

;; ANSWER SECTION:
google.com.		179	IN	A	172.217.208.102
google.com.		179	IN	A	172.217.208.139
google.com.		179	IN	A	172.217.208.101
google.com.		179	IN	A	172.217.208.138
google.com.		179	IN	A	172.217.208.100
google.com.		179	IN	A	172.217.208.113

;; Query time: 11 msec
;; SERVER: 192.168.1.251#53(192.168.1.251)
;; WHEN: Wed May 06 18:55:37 CEST 2026
;; MSG SIZE  rcvd: 135
dig pihole.home @192.168.1.251

; <<>> DiG 9.10.6 <<>> pihole.home @192.168.1.251
;; global options: +cmd
;; connection timed out; no servers could be reached

Do you see something on the Pi-hole Query Log page?

I do actually! This is more confusing than before :thinking:

Capture d’écran 2026-05-06 à 18.58.06

Capture d’écran 2026-05-06 à 18.57.58

So pi-hole did see the query and answered it but for some reason it didn't reach my computer. I'm now completely lost :sweat_smile:
This makes me think it might not be an issue on pi-hole but I'm not much more advanced...