为什么Microsoft Edge打开一些本地网站,而不是其他域,其中的域名路由到主机文件中的127.0.0.1 [英] Why does Microsoft Edge open some local websites, but not others, where the domain name is routed to 127.0.0.1 in hosts file

查看:521
本文介绍了为什么Microsoft Edge打开一些本地网站,而不是其他域,其中的域名路由到主机文件中的127.0.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像很多程序员一样,我在本地测试网站。

我使用hosts文件将域名映射到本地ip(127.0.0.1)。



我使用合格的域名,通常使用d子域名(开发)。



例如:

  d.somewebsite.com 
d.anotherwebsite.com
等等...

在微软边缘,大多数网站都可以工作。但是,他们中的几个没有。没有什么特别或奇怪的域名将不起作用。只需一个简单的 d.someletters.com



他们可以在Chrome,IE和Firefox中正常工作。 p>

在Edge中,我收到错误消息:
嗯,我们无法访问此页面。



起初我以为没有解决IP。但是,我意识到当我在另一个非相关网址上输错字时,主机文件不会路由的请求被发送到我的ISP来解决。如果我的ISP无法解决这个问题,他们会发送这个特殊的搜索结果页面,并提供您可能想要查找的内容。那么当我去我的本地域时,我的ISP没有这个页面。我从边缘直接得到上面提到的错误。



所以,在我看来,Edge正在正确地解析域,否则它会被发送到我的ISP的DNS。



所以,我会认为,也许Edge不能连接到本地机器。但就像我说的,其中几个本地域名正常工作。另外,直接在Edge中使用127.0.0.1也可以。只是这几个域名给我一个问题。只有在Edge(所有其他浏览器工作)中有任何想法?



如果重要的话,Web服务器是Apache2(xampp)。



此外,如果我在Edge中打开调试窗口并监视网络,我根本看不到任何请求。



编辑:我不再使用主机文件。我的dnsmasq在我的一个Linux盒子上运行,我正在使用它作为DNS而不是主机。也不再使用环回(显然,因为DNS现在在另一个盒子上),我正在使用一个内部的私有IP地址(192.168 ...)。

解决方案


  • 您的网络可以阻止环回作为Windows 10中的安全措施


  • 以管理员身份打开命令提示符,运行此操作可免除Edge环回:

      CheckNetIsolation LoopbackExempt -a -n =Microsoft.MicrosoftEdge_8wekyb3d8bbwe



    • Like a lot of programmers, I test sites locally.
      I use the hosts file to map domain names to my local ip (127.0.0.1).

      I use qualified domain names, usually with a "d" subdomain (for "development").

      For example:

      d.somewebsite.com 
      d.anotherwebsite.com 
      and so on...
      

      In Microsoft edge, most of the web sites work. However, a couple of them do not. There is nothing special or weird about the domain names that won't work. Just a simple d.someletters.com.

      They work fine in Chrome, IE, and Firefox.

      In Edge, I get the error message: "Hmm, we can't reach this page."

      At first I thought it wasn't resolving the IP. However, I realized when I made a typo on another non-related url, that requests which are not routed by the hosts file are sent to my ISP to be resolved. If my ISP can't resolve it, they send back this special search results page with suggestions of what you might be trying to find. Well, when I go to my local domain, I do not get this page from my ISP. I get the error mentioned above straight from edge.

      So, it seems to me that Edge is resolving the domain correctly, otherwise it would have been sent off to my ISP's DNS.

      So, I would think then that maybe Edge just can't connect to the local machine. But like I said, several of these local domains are working fine. Also, using 127.0.0.1 directly in Edge also works. It's just these couple of domain names giving me a problem. And only in Edge (all other browsers work) Any ideas?

      The web server is Apache2 for Windows (xampp) if that matters.

      Also, if I open the debug window in Edge and monitor the network, I do not see any requests going out at all.

      EDIT: I am no longer using the hosts file. I have dnsmasq running on one of my Linux boxes and I am using it for DNS instead of hosts. Also no longer using loopback (obviously since DNS is on another box now), I am using an internal private ip address (192.168...). Same issue.

      解决方案

      • Your network can block loopback as a security measure in Windows 10.

      • Open a command prompt as administrator, and run this to exempt Edge from a loopback:

        CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
        

      这篇关于为什么Microsoft Edge打开一些本地网站,而不是其他域,其中的域名路由到主机文件中的127.0.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆