What's new

Needing to forward select FQDN or subdomains upstream, that the router expects to be on my local domain.

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

dominatorstang

Occasional Visitor
I am using a local domain name on my network and it has been working well for me. I am also using an ISP that I can not host behind, so I tunnel into a VPS and host from my local services that way and I pay for a domain name. Next I add host name entries into the DHCP manual assignment list to point at my local nginx so that if I am on the LAN or WLAN then it will directly use that service, but if I am remote or on Cellular then it will go through the tunnel.

That all works pretty good, but then I added another sites network in the same way and am using the same domain name, so I do not have to pay for another domain. Now comes the tricky part it makes it so I can not access the other sites services from my LAN/WLAN since they share the same domain name and the router just keeps the request in the local network.

I know the proper way is for the other site to have its own domain name, and I am open to other solutions, but my first though is to have a list of subdomains that should passthrough or forward upstream. I am just not sure how to do that in the GUI or CLI
 
I am using a local domain name on my network and it has been working well for me. I am also using an ISP that I can not host behind, so I tunnel into a VPS and host from my local services that way and I pay for a domain name. Next I add host name entries into the DHCP manual assignment list to point at my local nginx so that if I am on the LAN or WLAN then it will directly use that service, but if I am remote or on Cellular then it will go through the tunnel.

That all works pretty good, but then I added another sites network in the same way and am using the same domain name, so I do not have to pay for another domain. Now comes the tricky part it makes it so I can not access the other sites services from my LAN/WLAN since they share the same domain name and the router just keeps the request in the local network.

I know the proper way is for the other site to have its own domain name, and I am open to other solutions, but my first though is to have a list of subdomains that should passthrough or forward upstream. I am just not sure how to do that in the GUI or CLI

The router will only keep local requests for whatever domain is specified exactly (and even then only if you don't tell it to forward those upstream).

For example if you set the router to "intra.domain.com" then it will only reply to those requests, and any requests for "domain.com" or "somethingelse.domain.com" will be sent upstream.

So that is an easy way to fix via the GUI, use a subdomain for local stuff and everything else will get forwarded upstream.

Otherwise you need to use a dnsmasq.postconf script to tell it what to keep local vs what to send along. You can even specify a different upstream server for different subdomains etc.
 
Okay, I am going to research and work on implementing a dnsmasq.postconf script. Thank you drinkingbird.

I had at first tried to use a two different subdomains, but I am using a Cloudflare free plan and it was not liking me using a sub subdomain, like service.sub1.domain.com and service.sub2.domain.com. Cloudflare Would give me an error of not having a certificate and needing to purchase one. Maybe something I should investigate further there too.
 
Last edited:
I know the proper way is for the other site to have its own domain name, and I am open to other solutions, but my first though is to have a list of subdomains that should passthrough or forward upstream. I am just not sure how to do that in the GUI or CLI

If you know this - why are you trying to do it the really hard way...

register the domain, add the DNS appropriate records, and call it done - time is better spent doing other things.
 
Okay, I am going to research and work on implementing a dnsmasq.postconf script. Thank you drinkingbird.

I had at first tried to use a two different subdomains, but I am using a Cloudflare free plan and it was not liking me using a sub subdomain, like service.sub1.domain.com and service.sub2.domain.com. Cloudflare Would give me an error of not having a certificate and needing to purchase one. Maybe something I should investigate further there too.

Yeah that's a different battle, if you want SAN (subject alternative name) on your SSL, which lets 1 cert work with multiple subdomains, or even multiple domains, they make you pay for it.

I'm not totally following the setup you have but you can use the subdomains locally just for your LAN DNS resolution and forward queries for the main domain(s) upstream, by making sure the router is configured with the subdomain.

I use cloudflare for DDNS only, and I use intra.mydomain.com for the asus router and mydomain.com for DDNS. Lookups for local devices come from the router and looking up my domain goes upstream and returns the external IP.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top