I have a domain name registered and i made an A record on it that points to 127.0.0.1 (aka localhost). I want to be able to work on websites in this case from machines that are in the same network as the server its running on but those servers are not open to the public internet. I still want to use my test subdomain to access this website but that would point to the machine im working on at that time so it must forward the requests to an 192.168.. ip adress I have set entered on the machine. Is there a windows command i could use that forwards localhost to a specific ipadress, like linux has 'iptables'? Or a program that could do this? Preferably for free. I dont want to add my internal ipadress to a dns record because that would be sensitive information.
What about adding an entry to /etc/hosts
(linux) or c:\Windows\System32\Drivers\etc\hosts
(windows) ?
The format is: <ip address> <servernname>
, e.g.: 192.168.10.12 www.stackoverflow.com
.
Once you did that, accessing http://www.stackoverflow.com
from the machine where the hosts
file has been edited will end up being served by the server running on 192.168.10.12
.