1
1
I have set up a home server on my local home network. I have a registered domain name & website through a hosting provider and have configured a subdomain A record with the hosting provider to point to my local network IP (ex: server.mydomain.tld). NAT & firewall rules are in place so that when I am NOT on my home network, I can access the server through my browser at server.mydomain.tld. Also SSL certificate is set up through LetsEncrypt. TLDR, when I'm off the home network, everything works great.
PROBLEM: If I am ON my home network (the same network as the server), and I try to navigate to server.mydomain.tld, I either get: a) The firewall login page, or b) A browser error about a self-signed certificate (which looks to be provided by the firewall) which I can bypass and then... get to the firewall login page
Note: If instead of server.mydomain.tld I navigate to the server's local IP address, then I can access the server portal as expected.
What sort of routing, NAT, and/or DNS rules do I need to configure on my firewall so that when I am ON the home network with the server, server.mydomain.tld takes me directly to the local IP of the server?
Please let me know if more information would be helpful. Thanks!
For a simple home network, put the server name / IP association in the local HOSTS file of the workstation trying to access the server – John – 2019-11-25T01:49:05.413
1
This is called hairpin NAT. Your router may not support it, or it may require additional configuration in regards to more advanced NAT/Masquerade rules. Typically, it’s best to avoid it and have an internal DNS server hand out local IPs for internal servers. When on the internet you’ll get the public IP, when internal you’ll get the local IP and bypass your router. A HOSTS file addition will also solve the issue but is going to cause issues when you move in to and out of your network.
– Appleoddity – 2019-11-25T05:31:28.967