Pihole clients not resolving Pihole hostname

Expected Behaviour:

I have an Alpine (3.22) VM running Pihole (latest: 2025.06.2) as a docker container (docker compose 2.36.2-r0). My pihole server forwards local queries to a domain controller for mydomain.local. I can ping/nslookup my PC, domain controller, etc by their hostname and FQDN. I cannot successfully ping or nslookup the pihole VM (pihole1 or pihole.mydomain.local) or pi.hole.

I do notice the nslookup identifies my Pihole server as pi.hole, but cannot ping/nslookup that pi.hole name.

nslookup dc1
Server:  pi.hole
Address:  10.1.10.251

Name:    dc1.mydomain.local
Address:  10.1.10.11
ping dc1

Pinging dc1.mydomain.local [10.1.10.11] with 32 bytes of data:
Reply from 10.1.10.11: bytes=32 time=1ms TTL=128...

Actual Behaviour:

nslookup pihole1
Server:  pi.hole
Address:  10.1.10.251

Name:    pihole1.mydomain.local
Addresses:  fe80::be24:11ff:fe0e:456e
          0.0.0.0
ping pihole1
Ping request could not find host pihole1. Please check the name and try again.
ping pi.hole
Ping request could not find host pi.hole. Please check the name and try again.

Debug Token:

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

Additional info: I did find an old thread (Pihole not resolving it's own hostname - #9 by gniting) where this sort of behavior was resolved years ago by a bugfix. I've tried a few of the suggestions from that thread, and nothing seems to resolve the issue.

.local is reserved for mDNS protocol usage and should not be mixed with plain DNS.

Also, if pi.hole isn't resolved, that would suggest that the reply wasn't provided by Pi-hole.

Please run the following commands while monitoring /var/log/pihole/pihole.log (e.g. via Tools | Tail log files | pihole.log):

nslookup pi.hole
nslookup pi.hole 10.1.10.251
nslookup pihole1. 10.1.10.251

Please share the output along with the corresponding log lines from pihole.log.

My mistake for genericizing with .local; my domain is not actually a ".local". I'll just use leave it as the actual domain (337.ninja) to keep it simple.

nslookup pi.hole
Server:  pi.hole
Address:  10.1.10.251

Name:    pi.hole
Addresses:  fe80::be24:11ff:fe0e:456e
          0.0.0.0
2025-06-19 11:48:21.797 query[PTR] 251.10.1.10.in-addr.arpa from 10.1.10.50
2025-06-19 11:48:21.798 config 251.10.1.10.in-addr.arpa is <PTR>
2025-06-19 11:48:21.809 query[A] pi.hole.337.ninja from 10.1.10.50
2025-06-19 11:48:21.811 forwarded pi.hole.337.ninja to 10.1.10.11
2025-06-19 11:48:21.816 reply pi.hole.337.ninja is NXDOMAIN
2025-06-19 11:48:21.817 query[AAAA] pi.hole.337.ninja from 10.1.10.50
2025-06-19 11:48:21.818 cached pi.hole.337.ninja is NXDOMAIN
2025-06-19 11:48:21.819 query[A] pi.hole from 10.1.10.50
2025-06-19 11:48:21.819 Pi-hole hostname pi.hole is 0.0.0.0
2025-06-19 11:48:21.823 query[AAAA] pi.hole from 10.1.10.50
2025-06-19 11:48:21.823 Pi-hole hostname pi.hole is fe80::be24:11ff:fe0e:456e
nslookup pi.hole 10.1.10.251
Server:  pi.hole
Address:  10.1.10.251

Name:    pi.hole
Addresses:  fe80::be24:11ff:fe0e:456e
          0.0.0.0
2025-06-19 11:52:08.200 query[PTR] 251.10.1.10.in-addr.arpa from 10.1.10.50
2025-06-19 11:52:08.201 config 251.10.1.10.in-addr.arpa is <PTR>
2025-06-19 11:52:08.202 query[A] pi.hole.337.ninja from 10.1.10.50
2025-06-19 11:52:08.203 cached pi.hole.337.ninja is NXDOMAIN
2025-06-19 11:52:08.204 query[AAAA] pi.hole.337.ninja from 10.1.10.50
2025-06-19 11:52:08.204 cached pi.hole.337.ninja is NXDOMAIN
2025-06-19 11:52:08.206 query[A] pi.hole from 10.1.10.50
2025-06-19 11:52:08.206 Pi-hole hostname pi.hole is 0.0.0.0
2025-06-19 11:52:08.207 query[AAAA] pi.hole from 10.1.10.50
2025-06-19 11:52:08.207 Pi-hole hostname pi.hole is fe80::be24:11ff:fe0e:456e
nslookup pihole1. 10.1.10.251
Server:  pi.hole
Address:  10.1.10.251

*** pi.hole can't find pihole1.: Server failed
2025-06-19 11:54:22.832 query[PTR] 251.10.1.10.in-addr.arpa from 10.1.10.50
2025-06-19 11:54:22.832 config 251.10.1.10.in-addr.arpa is <PTR>
2025-06-19 11:54:22.834 query[A] pihole1 from 10.1.10.50
2025-06-19 11:54:22.835 forwarded pihole1 to 10.1.10.11
2025-06-19 11:54:22.835 forwarded pihole1 to 10.1.10.13
2025-06-19 11:54:22.836 reply error is SERVFAIL
2025-06-19 11:54:22.838 query[AAAA] pihole1 from 10.1.10.50
2025-06-19 11:54:22.838 forwarded pihole1 to 10.1.10.13
2025-06-19 11:54:22.839 forwarded pihole1 to 10.1.10.11
2025-06-19 11:54:22.840 forwarded pihole1 to 10.1.10.13
2025-06-19 11:54:22.840 reply error is SERVFAIL
nslookup pihole1 10.1.10.251
Server:  pi.hole
Address:  10.1.10.251

Name:    pihole1.337.ninja
Addresses:  fe80::be24:11ff:fe0e:456e
          0.0.0.0
2025-06-19 11:57:51.833 query[A] pihole1.337.ninja from 10.1.10.50
2025-06-19 11:57:51.833 Pi-hole hostname pihole1.337.ninja is 0.0.0.0
2025-06-19 11:57:51.834 query[AAAA] pihole1.337.ninja from 10.1.10.50
2025-06-19 11:57:51.834 Pi-hole hostname pihole1.337.ninja is fe80::be24:11ff:fe0e:456e

Thank you for sharing those results.

To complete analysis, could you please share your docker compose or docker run script for starting your Pi-hole container?

name: <pihole.337.ninja>
services:
    pihole:
        container_name: pihole
        deploy:
            resources:
                limits:
                    memory: "1024MB"
        environment:
            FTLCONF_webserver_api_password: 'XXX'
            CAP_NET_ADMIN: true
            CAP_SYS_NICE: true
            CAP_SYS_TIME: true
            PIHOLE_UID: 1000
            PIHOLE_GID: 1000
            TZ: America/New_York
            VERSION: docker
        hostname: pihole1.337.ninja
        restart: unless-stopped
        network_mode: host
        volumes:
            - /mnt/data/dnsmasq.d:/etc/dnsmasq.d
            - /mnt/data/pihole:/etc/pihole
        image: pihole/pihole

Your nslookup pi.hole results demonstrate that Pi-hole has been used for at least that specific DNS requests, and it has been processing and answering that request:

Your docker compose reveals that you haven't set an IP address, which explains 0.0.0.0 showing up as a result.

Please add the following two FTLCONF_* lines to your docker compose environment: section (additional lines below shown for context):

services:
  pihole: (…)
    ports: (…)
    environment:
      (…)
      FTLCONF_dns_reply_host_IPv4: '10.1.10.251'
      FTLCONF_dns_reply_host_force4: true

In case your actual IPv4 is different or has changed, replace 10.1.10.251 with the correct IP address.

When done, stop and remove your Pi-hole container before rerunning your docker compose.

1 Like

That's the environment variable I needed!

My VM gets its IP from DHCP, statically assigned to the MAC address from the router so I can manage all addressing in one place. I was expecting Pihole to read that as [current IP] instead of [no IP], but I understand how the expectation of a static IP would cause confusion. I would expect Pihole to hand out its own IP for pi.hole (which is not in my DNS server), but I am surprised it hands out its own IP for its hostname instead of handing that request off to the DNS server. It's now handing out the correct IP for pi,hole, pihole1, & pihole1.337.ninja. If the IP ever does change, I'll need to remember to update the compose.yaml. Might put that into the VM notes.

Thanks for getting me straightened out, @Bucking_Horn!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.