DNS name resolution only on your own computer

Pi Hole running in a docker contaier in a raspbianOS, RPi4 machine. My compose file:

version: "3"

    container_name: pihole
    image: pihole/pihole:latest
    network_mode: "host"
      TZ: 'Europe/Budapest'
      WEBPASSWORD: 'pwd'
      VIRTUAL_HOST: 'pi.hole'
      PROXY_LOCATION: 'pi.hole'
      DNSSEC: 'true'
      DHCP_ROUTER: ''
      DHCP_START: ''
      DHCP_END: ''
      # INTERFACE: The default works fine with our basic example docker run commands. If you're trying to use DHCP with --net host mode then you may have to customize this or DNSMASQ_LISTENING.
      WEB_PORT: 81

      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
      - '/etc/hosts:/etc/hosts' 
      - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed
    restart: unless-stopped

Expected Behaviour:

  • On my router (, is an DHCP server, this is working fine. Still the RPi has a fix IP address, but this is synced, so this is fine.
  • I would like host name resolution with the Pi Hole DNS server, as I set up in the /etc/pihole/custom.list file.

Actual Behaviour:

DNS name resolution not working on my home network. But on the pi, outside the docker container is fine. Somtime I can access the http://pi.hole address, and send me the standard 80 port Apache. But that's all. Error messages:

DNSMASQ_WARN	Warning in dnsmasq core:
ignoring nameserver - local interface

nslookup for the pi ip address:

** server can't find NXDOMAIN

or the name:

nslookup pi464

** server can't find pi464: SERVFAIL

pihole log file details, here looks everything working.

Mar 19 17:43:47 dnsmasq[310]: query[A] pi464 from
Mar 19 17:43:47 dnsmasq[310]: Pi-hole hostname pi464 is
Mar 19 17:43:47 dnsmasq[310]: query[AAAA] pi464 from
Mar 19 17:43:47 dnsmasq[310]: Pi-hole hostname pi464 is fe80::9ab0:fbe8:fd82:6ab4
Mar 19 17:43:54 dnsmasq[310]: query[A] pi.hole from
Mar 19 17:43:54 dnsmasq[310]: Pi-hole hostname pi.hole is
Mar 19 17:44:24 dnsmasq[310]: query[A] pi.hole from
Mar 19 17:44:24 dnsmasq[310]: Pi-hole hostname pi.hole is

My router DNS server is these machine of course.

Any idea, how can I solve these problem?

Since you've configured your Pi-hole container for port 81, your URL has to read http://pi.hole:81/admin.

The machine that ran that nslookup does not use Pi-hole for DNS, but a local stub resolver at
You could consider to configure that stub resolver to use Pi-hole as its upstream DNS server, or to disable that stub.

Unrelated to your issue, but if you intend to use your router for DHCP, you should drop the following lines from your docker-compose:

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