mescon / Muximux

A lightweight way to manage your HTPC
GNU General Public License v2.0
1.14k stars 83 forks source link

try private IP before public domain #160

Closed aporzio1 closed 7 years ago

aporzio1 commented 7 years ago

is there a way to have it try a local IP i.e. 192.168.x.x before trying my domain name.

Example: If I am home it would access the site by 192.168.x.x and if I am anywhere else it will go through my domain name

kube1984 commented 7 years ago

if your trying to do this on a local computer at home....add a host entry to redirect the url to local ip as that always takes presence before using DNS

aporzio1 commented 7 years ago

I could. but it would have to be done on every computer, and there is no solution for phone or tablet

mescon commented 7 years ago

I think this is already possible since this patch: https://github.com/mescon/Muximux/commit/b2d38ac9ae0b5dc2181fa14479c906b2139e66d7

Basically, try entering something like https://:443/sonarr which should become https://192.168.x.x:443/sonarr if you're visiting the site at 192.168.x.x. If you instead type somehost.com into your url to open up Muximux, the URL should become https://somehost.com:443/sonarr.

Don't know if it works - I don't use that function myself.

If you control your own DNS server, the technique to serve different answers to DNS requests depending on where they come from (i.e your internal network, or the external network) is known as Split-horizon DNS https://en.wikipedia.org/wiki/Split-horizon_DNS