向当地Netwerk上的ipadress转发Localhost

发布于 2025-01-28 18:07:48 字数 247 浏览 2 评论 0原文

我已经注册了一个域名,并且在其中制作了一个记录,指向127.0.0.1(又称Localhost)。在这种情况下,我希望能够从与服务器运行的服务器中的机器上使用网站上的工作,但这些服务器不向公共Internet开放。我仍然想使用我的测试子域来访问此网站机器。我可以使用Windows命令将Localhost转发到特定的iPadress,例如Linux具有“ Iptables”?还是可以这样做的程序?最好免费。 我不想将内部iPadress添加到DNS记录中,因为那将是敏感的信息。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

以歌曲疗慰 2025-02-04 18:07:48

将条目添加到/etc/hosts(linux)或c:\ windows \ system32 \ drives \ etc hosts(Windows)怎么样?

格式为:< ip地址> < servernname>,例如:192.168.10.12 www.stackoverflow.com

完成此操作后,访问http://www.stackoverflow.comhosts文件进行编辑的机器中最终将被服务器运行在<<代码> 192.168.10.12 。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文