Set up local DNS rewrites so Internal apps open at home
A local DNS rewrite tells your home devices that your app names live at your server’s LAN IP address. The request then stays inside your network. This page shows how to set one up in Pi-hole, AdGuard Home or your router.
The main reason to do this is Advanced mode. There, Traefik serves Internal apps on port 443 and External apps on port 444, and your router forwards 443 to 444. A home device that gets the server’s LAN IP goes to port 443, so Traefik treats it as Internal. Without a rewrite, your domain points to your public IP and the request may count as external. See If an Internal app won’t open from home.
To hear why Internal apps need this, watch Deployrr 5 walkthrough: hairpinning and DNS rewrites at 1:09:51 (shows Deployrr v5; menus differ in v6).
A rewrite also helps in Simple mode. Your traffic stays local and does not leave through your router.
Before you start
Section titled “Before you start”- Your domain and Traefik work. See Set up Traefik if they do not.
- You know your server’s LAN IP address. This page calls it
SERVER_LAN_IP. The server’s address must not change, so see Give your server a fixed IP address if it might. - You have a device on your network to test from, other than the server.
- Setup Mode is Hybrid. In Local mode Deployrr uses no reverse proxy, so you don’t need rewrites.
- Domain Checks and Traefik Production are done. See the next section for why.
Do the rewrite after Domain Checks
Section titled “Do the rewrite after Domain Checks”Deployrr’s Domain Checks look up your domain through the server’s own DNS. They expect your public IP. If the server itself uses a DNS server with your rewrite, check 4 and check 6 fail with an IP mismatch, because the domain now resolves to your LAN IP.
- Finish Domain Checks and Traefik before you add the rewrite. Deployrr keeps the passed result and does not rerun the checks on its own.
- If you must run Domain Checks again later, point the server’s own DNS at a public DNS server such as
1.1.1.1first, then switch it back.
Traefik is not affected. It checks its certificates against Cloudflare’s public DNS servers, not your local one.
Replace YOUR_DOMAIN with your domain and SERVER_LAN_IP with your server’s LAN IP wherever you see them.
Install Pi-hole from Deployrr (skip if you already have a DNS server)
Section titled “Install Pi-hole from Deployrr (skip if you already have a DNS server)”- In Deployrr, go to Apps > Browse Apps.
- Select Pi-hole and choose Install.
- At Do you want to install this app?, choose Yes.
- In Pi-hole - Password Configuration, keep the suggested password or type your own. Write it down. You need it to log in to Pi-hole.
- In Pi-hole - Configuration,
home.internalis filled in. This is the local domain Pi-hole uses for your home devices. Keep it or enter your own, such asmyhome.internal. Don’t enter your public domain here. - At Enter the port for Pi-hole (Web interface port), keep the suggested port (
83, or the next free port) or enter another. - Wait for the install to finish. Deployrr shows a note with the address of the Pi-hole web interface:
http://SERVER_LAN_IP:PORT/admin/.
Pi-hole uses port 53 on your server, and port 67 for DHCP. If the install fails with “address already in use”, see Pi-hole will not start because port 53 is already in use. Keep your router as the DHCP server: Pi-hole’s DHCP server doesn’t work in this setup (why).
Add the rewrite in Pi-hole
Section titled “Add the rewrite in Pi-hole”Menus differ between Pi-hole versions. Deployrr installs the latest Pi-hole release, and these steps match Pi-hole v6.
Use a wildcard to cover every app at once. Use single records if you only want a few apps.
Every app (wildcard):
-
Open the Pi-hole web interface and log in.
-
Go to Settings > All settings.
-
Switch to Expert view.
-
Open the Miscellaneous tab.
-
Find the
misc.dnsmasq_linessetting and add this line:address=/YOUR_DOMAIN/SERVER_LAN_IP -
Save.
One app at a time:
- Open the Pi-hole web interface and log in.
- Go to Settings > Local DNS Records.
- Add the domain
app.YOUR_DOMAINand the IP addressSERVER_LAN_IP, then add the record. - Repeat for each app.
Add the rewrite in AdGuard Home
Section titled “Add the rewrite in AdGuard Home”Use this if you run AdGuard Home on another device. AdGuard Home is not in the Deployrr v6 app list.
- Open the AdGuard Home web interface.
- Go to Filters > DNS rewrites.
- Select Add DNS rewrite.
- For the domain, enter
*.YOUR_DOMAIN. - For the IP address, enter
SERVER_LAN_IP. - Save.
Use your router instead
Section titled “Use your router instead”Many routers can do the same. OPNsense, for example, has Unbound host overrides. Look for “local DNS”, “host override” or “DNS rewrite” in your router settings. The names differ by brand. If you use OPNsense, also read Traefik staging fails with unable to obtain ACME certificate on OPNsense.
Test before you switch your network
Section titled “Test before you switch your network”In the next steps, DNS_SERVER_IP is the LAN IP of the device that runs your DNS server. If Deployrr installed Pi-hole, that is SERVER_LAN_IP.
-
On another device on your network, run this command. Use your own domain and IP:
Terminal window nslookup app.YOUR_DOMAIN DNS_SERVER_IP -
Read the answer. It should show
SERVER_LAN_IPas the address. -
If it shows your public IP, the rewrite is not saved or is in the wrong place. Check the steps above.
Point your devices at the DNS server
Section titled “Point your devices at the DNS server”- To test on one device first, open that device’s network settings and set its DNS server to
DNS_SERVER_IP. - To cover your whole network, open your router’s DHCP settings and set the DNS server to
DNS_SERVER_IP. The setting name differs by brand. - Restart the Wi-Fi on your devices, or wait for them to renew their DHCP lease.
Keep these in mind:
- If the server or the Pi-hole container is down, devices that use it lose DNS. Websites stop opening until it is back or you change the DNS setting. If the server itself uses Pi-hole, it also can’t renew certificates while Pi-hole is down.
- Do not add a public DNS server such as
1.1.1.1as a second DNS server on the same devices. A device may pick it and skip your rewrite. Then Internal apps open only some of the time.
Check it worked
Section titled “Check it worked”- On a device that uses the new DNS server, open
https://app.YOUR_DOMAIN. The app should open. - Turn off Wi-Fi on your phone and open the same address on mobile data. An Internal app should not open. An External or Both app should still open in Advanced mode.
If it still does not work
Section titled “If it still does not work”- The old answer is cached. Restart the browser. If that does not help, restart the device or clear its DNS cache (see Check which DNS server a device uses, step 6).
- The device does not use the new DNS server. See Check which DNS server a device uses.
- The browser ignores your DNS server. See Turn off secure DNS in the browser.
- Domain Checks now fail with an IP mismatch. The server uses your rewrite. See Do the rewrite after Domain Checks and Domain Checks failed.
- Pi-hole will not start. See Pi-hole will not start because port 53 is already in use.
Check which DNS server a device uses
Section titled “Check which DNS server a device uses”Do this when an Internal app opens on some devices but not on others, or only some of the time.
-
On the device that fails, run this. It works on Windows, macOS and Linux:
Terminal window nslookup app.YOUR_DOMAIN -
Read the output. The first
Server:andAddress:lines show the DNS server the device asked. The lastAddress:line is the answer. -
Compare with this table:
What you see What it means and what to do Server is DNS_SERVER_IP, answer isSERVER_LAN_IPDNS is fine on this device. If the browser still fails, see Turn off secure DNS in the browser. Server is your router’s IP, answer is your public IP The device asks your router, and the router doesn’t know the rewrite. Set the DNS server in the router’s DHCP settings to DNS_SERVER_IP, or add the rewrite in the router (see Use your router instead).Server is a public DNS server such as 1.1.1.1or8.8.8.8The device or the router has a public DNS server set by hand. Change it to DNS_SERVER_IPin the device’s network settings or the router’s DHCP settings.Server is an IPv6 address The device got a DNS server over IPv6, often from the router, and uses it instead of Pi-hole. In the router’s IPv6 or LAN settings, stop it from handing out its own DNS server, or hand out the IPv6 address of the device that runs Pi-hole. The setting names differ by brand. Server is 127.0.0.53(Linux)The device uses a local DNS cache (systemd-resolved). Run resolvectl statusand read theCurrent DNS Serverline to see the real server. -
To see the DNS servers a device has, run
ipconfig /allon Windows (look for DNS Servers) orresolvectl statuson Linux. On macOS, open System Settings > Network, select your connection, then Details > DNS. -
To ask your DNS server directly from Linux or macOS, use
dig. It is in thednsutilspackage on Debian and Ubuntu:Terminal window dig +short app.YOUR_DOMAIN @DNS_SERVER_IPIt should print
SERVER_LAN_IP. Rundig app.YOUR_DOMAINwithout@. The;; SERVER:line near the end shows which server the device uses. -
After you change a device’s DNS server, clear its DNS cache:
- Windows:
ipconfig /flushdns - macOS:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - Linux with systemd-resolved:
resolvectl flush-caches - Phones: turn Wi-Fi off and on again.
- Windows:
nslookup and dig ask the DNS server directly. A right answer there doesn’t prove that your browser uses the same server, so check the browser too.
Turn off secure DNS in the browser
Section titled “Turn off secure DNS in the browser”Most browsers can send DNS lookups over HTTPS to their own provider, such as Cloudflare or Google. These lookups skip Pi-hole and your rewrite, so the browser gets your public IP while nslookup shows SERVER_LAN_IP.
Turn it off on each device where Internal apps fail. Menu names and places change between browser versions. If you can’t find the setting, search the browser’s settings for “secure DNS” or “DNS over HTTPS”.
- Chrome: Settings > Privacy and security > Security > Use secure DNS. Turn it off.
- Edge: Settings > Privacy, search, and services, then find Use secure DNS. Turn it off.
- Brave: Settings > Privacy and security > Security > Use secure DNS. Turn it off.
- Firefox: Settings > Privacy & Security > DNS over HTTPS. Choose Off.
- Android (affects all apps on the phone): Settings > Network & internet > Private DNS. Choose Off or Automatic. If a provider hostname is set here, the phone skips Pi-hole for every lookup.
Close and reopen the browser, then open https://app.YOUR_DOMAIN again.

