3

I have this Linux server in my LAN, which can be reached from anywhere using dyndns services. So when I am out, I enter myserver.dyndns.org to get to it. When I am at home, I could do that too, but since the computer is in the same LAN, it's faster to use the internal address myserver.fritz.box.

But I ssh to the server using different profile bookmarks, I have the mail program on my laptop set up to use the external dyndns address to IMAP to it, and I have a cacert certificate tied to myserver.dyndns.org - there are many cases to use the external address, even when I am at home.

So I am wondering, if I could route my connections to myserver.dyndns.org from inside directly to myserver.fritz.box, without going through external DNS servers. I use an AVM Fritzbox as routing device with Firmware: FRITZ!OS 05.22, so maybe I can tell that Fritzbox to do that. I have no idea how to to it though - the docs do not help me there.

Another thought was to use the /etc/hosts file on my laptop, to route to that IP address but this would not work when I am not at home.

So how can I do it?

mcnesium
  • 571

1 Answers1

0

I thought of two possible solutions to this:

  1. Using your hosts file: You could write a script that checks if you are in your home network. If it changes: Update the hosts file accordingly. Best case the OS provides a listener for network changes (instead of checking every x seconds)
  2. Using a local DNS server: Create a custom DNS server in your home network that catches myserver.dyndns.org and returns your server's local ip.

Disclaimer: I am aware this question is 10 years old. But to me it is still recent. I have the same question and this is the only place I found this question asked.