How to access another server on LAN through public dynamic DNS host name

I have a server (let's call it serverX) on my LAN serving HTTPS/443 and OpenWrt is configured to forward WAN port 443 to serverx on LAN 443. serverX periodically gets my WAN public IP and publishes it to a DNS A record (i.e. dynamic DNS) and let's say it's at host name serverx.example.com. I can access serverX from my laptop using its 192 IP address while on my OpenWrt LAN. I can also access serverX when I'm not on my home LAN by using serverx.example.com. However, I cannot access serverx.example.com while on my LAN. I tried forwarding LAN 443 traffic to the serverX IP, but that then of course broke accessing the OpenWrt console at 192.168.8.1 so I had to root in and update /etc/config/firewall to revert that.

How can I access another server's port 443 that's on my LAN through the public IP that then should be forwarded to that server?

nginx apache etc.
maybe it is better to dial vpn home if services are not public?

Usually easier to resolve the domain name to the internal address when inside the network. Then it works even when the Internet is down and during external address changes.

Network -> DHCP and DNS -> DNS Records page, Hostnames page. Add an entry for the domain with the internal IP address.

2 Likes

Perfect, thanks! For me, it was Network } DNS } Edit Hosts
Works like a charm, thank you!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.