Skip to content

Pi-hole (dnsmasq) not listening on port 53 due to except-interface=nonexisting (Unraid) #307

@JudoFlash

Description

@JudoFlash

Problem Description:
The Pi-hole DNS server within the mpgirro/docker-pihole-unbound container fails to listen on network interfaces on port 53, resulting in "connection refused" errors when attempting to resolve DNS queries from the host. Unbound, however, functions correctly on 127.0.0.1:5335.

Observed Behavior:

  • netstat -tulnp | grep ":53" inside the container consistently shows:
    tcp        0      0 127.0.0.1:5335          0.0.0.0:* LISTEN      -
    udp        0      0 127.0.0.1:5335          0.0.0.0:* -
    
    (Only Unbound listening, no 0.0.0.0:53 or :::53 for dnsmasq).
  • dig @<your_container_ip> pi.hole from the host (e.g., dig @192.168.0.33 pi.hole) results in:
    ;; communications error to <your_container_ip>#53: connection refused
    ;; no servers could be reached
    
  • The file /etc/pihole/dnsmasq.conf inside the container consistently contains the line except-interface=nonexisting.
  • This problematic line automatically reappears in /etc/pihole/dnsmasq.conf after the container is restarted from Unraid.
  • The FTL.log repeatedly shows: CRIT: Error in dnsmasq configuration: bad port at line 33 of /etc/pihole/dnsmasq.conf (though line 33 in the file is a comment).

Expected Behavior:
Pi-hole (dnsmasq) should listen on port 53 on the configured network interfaces (e.g., br0 / 0.0.0.0 for IPv4 and :: for IPv6) to serve DNS queries, as intended by FTLCONF_dns_listeningMode=all.

Steps to Reproduce:

  1. Run the mpgirro/docker-pihole-unbound container on Unraid.
  2. Set environment variables:
    • PIHOLE_INTERFACE=br0
    • FTLCONF_dns_listeningMode=all
    • DNS1=127.0.0.1#5335
    • TZ=<your_timezone>
    • WEBPASSWORD=<your_secure_password>
    • DNSSEC=true (if applicable)
    • REV_SERVER=true,<your_local_subnet>,<your_router_ip>#53,lan (if applicable)
    • (List all other environment variables you are using for the container setup).
  3. Observe netstat -tulnp | grep ":53" and cat /etc/pihole/dnsmasq.conf after container startup/restart.

Environment:

  • Host OS: Unraid 7.1.3
  • Docker Image: mpgirro/docker-pihole-unbound:latest (or specific tag if used)
  • Pi-hole FTL Version: v6.2.2 (from FTL.log)

Request:
Please provide guidance on how to prevent except-interface=nonexisting from being added to dnsmasq.conf, or if this is a bug, please consider a fix in a future image release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions