Nginx Proxy Manager and Local DNS with Pi-hole
I ran into a slightly confusing DNS issue while using a local hostname as an upstream in Nginx Proxy Manager:
app.home.arpa → NPM → app.internal.home.arpa:3000
For this to work, Pi-hole needs to be configured as the DNS server in two places.
Host DNS
First, the NPM host or container needs to use Pi-hole as its resolver:
nameserver 192.0.2.53
For a Proxmox LXC, configure this through Container → DNS → DNS servers instead of editing /etc/resolv.conf directly.
Verify that the hostname resolves from the container:
cat /etc/resolv.conf
nslookup app.internal.home.arpa
Nginx DNS
Nginx can use a separate resolver for upstream hostnames. Check the NPM resolver configuration:
cat /etc/nginx/conf.d/include/resolvers.conf
It should point to Pi-hole as well:
resolver 192.0.2.53;
After changing it, test and reload Nginx:
nginx -t
systemctl reload nginx
If only /etc/resolv.conf is correct, a request from the NPM host can work perfectly:
curl http://app.internal.home.arpa:3000
NPM may still return a 502 Bad Gateway while the Nginx error log says:
could not be resolved (3: Host not found)
The short version: both the OS resolver and the Nginx resolver need to know about the local DNS records.