u/iRegue

▲ 5 r/Adguard+1 crossposts

Local DNS rewrite not working for Cloudflare exposed services (AdGuard + NPM + Cloudflared)

Hi everyone,

I'm hoping someone has run into this issue before and can help me out.

I currently have a Proxmox server running some LXCs, but i have a problem with this three:

  • Cloudflared (for my Cloudflare Tunnel)
  • AdGuard Home
  • Nginx Proxy Manager (NPM)

My router's DNS is set to the AdGuard IP so it handles requests and redirects them to NPM when needed. I have a DNS rewrite configured in AdGuard Home so that *.mydomain.com always points to the NPM IP.

Here is the issue: I think there's a problem with the services I have exposed to the internet. Even though my local DNS should be routing them directly to NPM, the traffic seems to be going out to the internet because I'm hitting the Cloudflare Access screen asking for an email/One-Time Pin.

This only happens with Home Assistant and my NAS, which are the only services I have exposed. Any other service that doesn't have a CNAME record in Cloudflare resolves internally perfectly fine through AdGuard/NPM.

For context, I bought the domain directly through Cloudflare and the tunnel itself is working without any issues.

Why is the local DNS rewrite being bypassed for services with a Cloudflare CNAME?

Thanks in advance for any help!

reddit.com
u/iRegue — 22 hours ago