Recommended setup to resolve server locally

Sorry this may be a noob question but I am having trouble setting this up.

I have a small server that was visible from the WAN (an ADSL connection with a cheap modem between the world and my Omnia) and I have a domain name for its WAN IP address. It used to work fine - I just had to add the port forwarding rules and that was it, I could connect to the server using its domain name from both within the LAN and from the WAN, apparently because my old ISP didn’t care when someone connected to the public IP address from the LAN side, it would always forward the request to the server.

Then I changed ISPs and now have a cable connection wired to a cable modem (or that’s what I think it is, it’s called “cable adapter” by the ISP) on one side, then a WiFi router (which my ISP calls “smart modem” and includes a 4G backup) connected to it and my Omnia on the LAN side of that.

First, I tried connecting the server to the LAN side of the WiFi router, where I again forwarded the ports. That worked when I wanted to connect from the WAN side (e.g. my mobile if I wasn’t connected to WiFi, from other places or when connecting via Tor), but failed when truing to connect to the server within the LAN.

Therefore my guess is that the ISP (or the devices that I have from them) doesn’t allow me to connect from the inside to the same public IP address that the router gets from them, but I might be wrong.

So I thought I could somehow tell my Omnia to re-direct all requests to the server’s domain, before they leave the LAN, directly to the server’s LAN IP address without my ISP even knowing. But I am at a loss of how to do that “correctly”.

Now I have the server connected to the Omnia, changed the port forwarding on the ISP’s WiFi router to the Omnia and from there to the server.

I can connect if I add the server’s domain to my PC’s hosts file, but I don’t want to have to do that for all LAN clients (including mobiles connecting via WiFi). I tried to add a custom hosts file to my Omnia including the host name, but that didn’t work either.

Any suggestions on how to deal with this situation would be very much appreciated.

See wiki: Turris Documentation

Though I expect it’s more reliable to solve such things on IP level (e.g. the firewall setting can do this, I think). Example issue: Firefox plans to tunnel all DNS to some external service by default.

1 Like

Awesome, that was quick :slight_smile:

For the benefit of others who might want to do the same, here’s what I did:

  1. Added the domain(s) to the /etc/hosts file.
  2. Added entry list hostname_config '/etc/hosts' to the kresd section of /etc/config/resolver
  3. Re-started the resolver with /etc/init.d/resolver restart.

Now my server is reachable from the LAN with its domain name. Thanks!

1 Like