Resolve Public Domain with Local DNS
If you've ever done self hosting and have bought a public domain, soon enough you'll come across resolving issues when you're on said home network.
For example, let's say you just purchased shiny-new-domain.com and you point that domain to your home IP address to get the static site. Now when you try to go to http://shiny-new-domain.com it takes a round trip through the external registry just to come all the way back home.
With Nginx Proxy Manager and Pi-hole you can locally resolve this domain so it uses local IP address. Traffic never leaves your home.
I'm going to add one more step here. I am able to create a local record proxy.lan so that it's easy to remember and replace if I ever need to swap in a different proxy server.
- Pi-hole https://pi.hole/admin/settings/dnsrecords
- local DNS records
- Domain =
proxy.lan, IP =192.168.0.101
- Domain =
- Local CNAME records
- Domain =
shiny-new-domain.com, Target =proxy.an
- Domain =
Test with dig
Test to see if it's working. the "ANSWER SECTION:" will let you know each travel step. You should only see local IP addresses.
dig shiny-new-domain.com @192.168.0.101
; <<>> DiG 9.10.6 <<>> shiny-new-domain.com @192.168.0.101
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1434
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;shiny-new-domain.com. IN A
;; ANSWER SECTION:
shiny-new-domain.com. 0 IN CNAME proxy.lan.
proxy.lan. 0 IN A 192.168.0.100
;; Query time: 55 msec
;; SERVER: 192.168.1.2#53(192.168.1.2)
;; WHEN: Mon Jul 27 20:32:17 CDT 2026
;; MSG SIZE rcvd: 86
192.168.0.100 is the PC that runs Nginx Proxy Manager
DNSMASQ
There is another way besides Local DNS and CNAME
https://pi.hole/admin/settings/all
under misc.dnsmasq_lines
sudo pihole-FTL --config misc.dnsmasq_lines
[ address=/williamusic.com/192.168.1.100, address=/tawtaw.site/192.168.1.100, address=/vpn.williamusic.com/192.168.1.2 ]
verify
nslookup west.williamusic.com 127.0.0.1
nslookup anything.williamusic.com 127.0.0.1
Why dnsmasq lines instead of Local DNS / CNAME records
The short answer: Pi-hole’s Local DNS page can’t do wildcards, and you wanted *.williamusic.com to resolve internally.
- Local DNS → DNS Records maps one exact hostname to one IP. There’s no way to say “every subdomain of williamusic.com.” You’d have to add a record for each subdomain you ever use, and any new one you forgot would fall through to public DNS.
- CNAME Records are also exact-match. A CNAME for
west.williamusic.comwould alias it to another name, and that name still needs to resolve to something, so it doesn’t solve the wildcard problem either. address=/williamusic.com/IP(a dnsmasq directive) matches the domain and every subdomain beneath it. One line covers everything, including names you haven’t created yet.