brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: DNS rewrites in AdGuard Home point a name at your own server

Network and access
~/tips/tip-adguard-home-dns-rewrites

rewrites:

Make a domain resolve to a local address for everyone on your network.

When you reach a self-hosted app by its public name from inside the house, it should go straight to the server, not out and back in. AdGuard Home’s DNS rewrites handle that.

In the web UI it lives under Filters, DNS rewrites. In the config file it looks like this:

rewrites:
  - domain: '*.home.example'
    answer: 192.0.2.10
    enabled: true
  - domain: nas.home.example
    answer: 192.0.2.20
    enabled: true

The wildcard sends every subdomain to the reverse proxy on 192.0.2.10, and the more specific entry gives the NAS its own address. The answer can be an IP address or another domain name, which works like a CNAME.

The docs mention two special answers. A or AAAA as the answer keeps the upstream’s records of that type, which is a way to rewrite only IPv4 and leave IPv6 alone, or the other way around.

Test from a client that uses AdGuard Home with nslookup nas.home.example and check you get the local address.

My caveat: phones and browsers that use their own encrypted DNS skip AdGuard Home completely, so they never see the rewrite and still go via the public address. If one device behaves differently, check its private DNS setting first.

Further reading: AdGuard Home configuration

Going deeper: Guide: AdGuard Home with Unbound: resolve DNS yourself instead of asking Cloudflare or your ISP

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link