I have problem accessing (one of my) web server from my local network.
I have a (Ubuntu) computer that that acts as router, web server etc. That works well, I can access the web server both externally and from the internal network. I can also access computers on the internal network via ssh from the outside (re-direction with iptables).
Now I have another web server on the internal network. I have made some routing paths with iptables. If I in the browser type some.webadress.com:40080
it should go to the “internal” web server.
This works:
- Access the internal web server with the domain name (+port) from an external network
- Access the internal web server with the internal IP number (+port) from the internal network
This does not work:
- Access the internal web server with the domain name (+port) from the internal network
I'm pretty sure that the routing part works ok. The question is if I have to have a DNS or is it something that I should add/change in my /etc/hosts
file?
EDIT:
Some clarification. The device/webserver that I'm having problem to reach is a webswitch. The webswitch is a device that makes it possible to control a number of high-voltage relays (e.g. car heater, external lights etc.) via the web/phone app. The problem arises when a smartphone is used. If I'm on the 3G net, I use some.webadress.com:40080
(note that I use port translation) and if I'm on the home-wifi I must use 192.168.0.101:8080
. What I want to use is some.webadress.com:40080
regardless if I'm on the local net or an external net.
(The better half in the family is not that interested in technical stuff so having to swift addresses is actually an issue :)