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"

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    network_mode: "host"
    environment:
      TZ: 'Europe/Budapest'
      WEBPASSWORD: 'pwd'
      FTLCONF_LOCAL_IPV4: '192.168.1.164'
      VIRTUAL_HOST: 'pi.hole'
      PROXY_LOCATION: 'pi.hole'
      DNSSEC: 'true'
      DHCP_ROUTER: '192.168.1.1'
      DHCP_START: '192.168.1.1'
      DHCP_END: '192.168.1.249'
      # 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.
      DNSMASQ_LISTENING: 'all'
      WEB_PORT: 81

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

Expected Behaviour:

  • On my router (192.168.1.1), 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 192.168.1.164 - local interface

nslookup for the pi ip address:

nslookup 192.168.1.164
** server can't find 164.1.168.192.in-addr.arpa: NXDOMAIN

or the name:

nslookup pi464
Server:         127.0.0.53
Address:        127.0.0.53#53

** 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 192.168.1.164
Mar 19 17:43:47 dnsmasq[310]: Pi-hole hostname pi464 is 192.168.1.164
Mar 19 17:43:47 dnsmasq[310]: query[AAAA] pi464 from 192.168.1.164
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 127.0.0.1
Mar 19 17:43:54 dnsmasq[310]: Pi-hole hostname pi.hole is 192.168.1.164
Mar 19 17:44:24 dnsmasq[310]: query[A] pi.hole from 127.0.0.1
Mar 19 17:44:24 dnsmasq[310]: Pi-hole hostname pi.hole is 192.168.1.164

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 127.0.0.53.
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.