You are not logged in.

#1 2019-12-15 10:28:46

Aromatix
Member
Registered: 2019-03-25
Posts: 13

resolve name dependent on network

I am running a webserver at my home. When accessing from outsite my home-network via myaddress.org everything works fine. From inside my network I can access via 192.168.1.10 it works as well. But from inside my network with myaddess.org it does not work. The address myaddress.org is resolved to my public ip-address and then when accessing my own ip-address, I think my router is not redircting to my webserver since the ip-forward is only for access from the outside. So what I wanted to do is, configure my router to resolve myaddress.org to 192.168.1.10 instead of redirecting to a dns-server. But my router does not support that.

It would be nice to make it work though, since some services on my laptop querry the webserver for information I would like to update wheter inside my homenetwork or not.

Right now my plan is to write a script that checks if I am in my homenetwork and than uncomments
# 192.168.1.10 myaddress.org
in /etc/hosts. Or comments it when im outsite. That obviously is
a) ugly and
b) only a solution for myself and not for other people on my network.

another idea is to make my webserver run a dns server as well and make this one the default dns server for my router as well (a solution I dont like as well bc. I dont want to rely on the server to run).

Does anyone know a better way or can point me in another direction?


I am here to learn. Feel free to message me about anything that might be interesting to me! Thanks wink

Offline

#2 2019-12-15 11:09:34

progandy
Member
Registered: 2012-05-17
Posts: 5,199

Re: resolve name dependent on network

You could try to replace your router with one that supports NAT loopback. Maybe your router can run OpenWRT? You could also use a raspberry pi zero (Wifi) or a FriendlyELEC zeropi (Ethernet) and use it as a DNS server or even pi-hole.

https://superuser.com/questions/1047745 … he-network

Edit: If you use your own DNS server, don't forget to prevent Firefox from setting up DNS-over-HTTPS: https://use-application-dns.net/. You can configure your DNS server to use an encrypted external connection instead if you want that.

Last edited by progandy (2019-12-15 11:13:15)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB