Hi everyone,
After hours of troubleshooting I finally solved the Pi-hole DNS failure on Ugreen NAS.
Sharing this because I saw many users with the same issue and no clear solution.
System: Ugreen NAS running UGOS Pro (confirmed on multiple models)
Symptom:
Pi-hole starts, web panel loads, but shows "DNS server failure" and no device gets DNS responses.
Logs show:
CRIT: Error in dnsmasq configuration: failed to create listening socket for port 53: Address in use
Root cause:
UGOS Pro runs dnsmasq instances that occupy port 53 before Pi-hole can bind to it:
- Virtual Machine app (libvirt) creates instances on 192.100.0.1:53 and 192.100.1.1:53
- The base system runs its own instance on 127.0.0.1:53
Confirm with: sudo ss -tulpn | grep :53
Solution:
-
Uninstall the Virtual Machines app from UGOS App Center (if you don't use VMs)
-
Stop and disable the system dnsmasq:
sudo systemctl stop dnsmasq
sudo systemctl disable dnsmasq -
Restart Pi-hole:
sudo docker compose down && sudo docker compose up -d -
Fix NAS DNS permanently:
echo "nameserver YOUR_NAS_IP" | sudo tee /etc/resolv.conf
sudo chattr +i /etc/resolv.conf
Working docker-compose.yml:
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
network_mode: host
cap_add:
- NET_ADMIN
- NET_BIND_SERVICE
environment:
TZ: America/Lima
WEBPASSWORD: 'your_password'
FTLCONF_webserver_port: 8090
FTLCONF_dns_listeningMode: single
FTLCONF_dns_interface: eth0
volumes: - /volume1/docker/pihole/etc-pihole:/etc/pihole
- /volume1/docker/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
restart: unless-stopped
Note: UGOS uses port 80, so set a different port for Pi-hole web interface with FTLCONF_webserver_port.
Note: If WEBPASSWORD doesn't apply on first start, reset it with:
sudo docker exec -it pihole pihole setpassword your_password
Hope this helps. Confirmed working on UGOS Pro.