Rerouting Internal Domain Queries Direct to TNAS

Hey all,
I’m sure this has been asked before… but I’ve been struggling to find relevant data.
Essentially I’ve connected a couple of my app ports to a domain I own to access from outside the local net, but I find it silly and a point of failure that when accessing them in my network the requests loop out to a name server somewhere else in the world then back to my router, to NginxPM then to my app. I would love to be able to redirect all requests made inside the network directly to the port.
Yes, I know I can access them via IP:port but I struggle to keep on top of all the port names and don’t want to have to save bookmarks for them on every device. Accessing Jellyfin via “videos.domain.com” from inside OR outside the network just makes sense. Plus the Jellyfin app doesn’t seem to be able to connect to the IP but has no issue connecting to the domain.

Here’s what I’ve got on my setup and my musings:

  • Pi-Hole as DNS - I had hoped I could just redirect the domain requests directly to the port but Pi-Hole doesn’t support choosing ports.
  • NginX Proxy Manager as Reverse Proxy Server - This handles incoming traffic beautifully but as far as I’m aware I can’t pass it internal requests as they’d need to be redirected by the router.
  • Archer AX50 router - The TPLink front-end is pretty decent but there’s seemingly no way to set any domain request rules etc.

I’m sure I’m far from the first person to ask this, so I appreciate your expertise in this area!

Sure you can. Set up a DNS override on your Pi-Hole pointing videos.domain.com to your NPM instance, and it should do the rest. For this to work well, your NPM instance needs to be listening on ports 80/443. See:

1 Like

Cheers, would that work for multiple subdomains?

Of course. I don’t use NPM for this (I use Traefik, and have used Caddy), but there’s no reason you can’t point dozens of subdomains to NPM, or even a wildcard pointing there.

G’damn, it all works perfectly. Just pointed a bunch of domain requests to it and each links through exactly as intended.
I guess I was overcomplicating things… got it in my head every request would just route to the TNAS GUI.