Chrome 本地主机不起作用 [英] Chrome localhost does not work

查看:17
本文介绍了Chrome 本地主机不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我定义了一些虚拟服务器,直到最后几天都运行良好.

现在它们不在 Chrome 上,但在 Firefox 或 safary 中没有问题.

我明白了:

<块引用>

此网页不可用

ERR_ICANN_NAME_COLLISION

隐藏详细信息

此站点使用新的通用顶级域 (gTLD).如果你有过去使用 loc.dev 访问内部站点,请联系您的网络管理员.

我找到了一个解决方案:

在 chrome://flags 中将内置异步 DNS"设置为禁用",但在我的 chrome 版本 (43.0.2357.81) 中没有这样的标志

您知道解决方案吗?

LE :如果我在 htdocs 文件上移动站点并访问 url

这是我所做的修复.

通过在 Chrome 浏览器中输入来清除谷歌 DNS 缓存

  • chrome://net-internals/#dns

屏幕截图 -> 刷新 Chrome DNS 缓存

  • 您将看到清除主机缓存"按钮.按那个 DNS 缓存将被刷新.

  • 保持此 DNS 窗口打开.现在在浏览器中访问虚拟主机对我来说是 http://api.localhost.一旦你这样做,你会看到一个DNS 窗口中的新条目.对我来说是本地主机."请注意显示错误的 localhost 末尾的句点.".

  • 最后一步是简单地将此条目添加到您的本地主机文件中.

您的主机文件应更新为将 localhost. 解析为 127.0.0.1 的条目:

# 不要忘记结尾的 .!!!127.0.0.1 本地主机.

在位于以下位置的主机文件中:

  • 对于Linux:/etc/hosts
  • 对于 Windows:C:WindowsSystem32driversetchosts

针对您的情况的另一种解决方案可能是在本地虚拟主机域的末尾丢弃 .dev

这与谷歌的一些新变化有关..dev"属于谷歌的顶级域名(在人们关心DNS的互联网角落,谷歌申请了一百多个新顶级域,包括.dev)

试试这个 使用您拥有的域名.根据您的设置,可能使用像localhost.dev.$yourdomain"这样的全名可以帮助您.

I have defined some virtual servers that until the last days were working fine.

Now they don't on Chrome, but there are no problems in firefox or safary.

I get this:

This webpage is not available

ERR_ICANN_NAME_COLLISION

Hide details

This site is using a new generic top-level domain (gTLD). If you have used loc.dev to access an internal site in the past, contact your network administrator.

I found as a solution:

Set the "Built-in Asynchronous DNS" to "Disabled" in chrome://flags, but the is no such flag in my chrome version ( 43.0.2357.81 )

Do you know a solution for this?

LE : If i move the site on the htdocs file and i go on the url http://localhost, it works. It seems that it has a problem only with virtualhosts.

解决方案

Got the same issue after updating to the latest chrome version last night. I was getting a ERR_NAME_NOT_RESOLVED error only on google chrome for all of my virtual hosts. Here's how that looked.

Screen Shot-> DNS name not resolved error

Here's the fix I made.

Clear up the google DNS cache by typing this in the Chrome browser

  • chrome://net-internals/#dns

Screenshot -> Flushing Chrome DNS cache

  • You will see a button "Clear Host Cache". Press that DNS cache will be flushed.

  • Keep this DNS window open. Now access the virtual host in the browser for me it was http:/api.localhost. Once you do that you will see a new entry in the DNS window. for me it was "localhost." notice the period "." at the end of localhost that showed an error.

  • Last step is to simply add this entry as to your localhost file.

Your hosts file should be updated with an entry to resolve localhost. to 127.0.0.1:

# dont forget the trailing . !!!
127.0.0.1 localhost.  

in the hosts file located at:

  • for linux : /etc/hosts
  • for windows : C:WindowsSystem32driversetchosts

Another solution for your case might be to ditch the .dev at the end of your local virtual host domain

This has to do with some new changes by google. ".dev" comes under google's TLD (In the corner of the internet where people care about DNS, there is a bit of an uproar at Google's application for over a hundred new top-level domains, including .dev)

Try this Use a domain name you own. Possibly using the full name like "localhost.dev.$yourdomain" could help you here depending on your setup.

这篇关于Chrome 本地主机不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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