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