Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome localhost does not work

Tags:

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.

like image 563
Alexandru Cioroianu Avatar asked May 26 '15 19:05

Alexandru Cioroianu


People also ask

Why localhost is not opening in Chrome?

It is triggered if the firewall wrongly blocks your server or you're using the wrong port. The localhost error can also happen if your Apache web server or Chrome browser is not configured correctly.

Why is my localhost not working?

The localhost simulates a web server running on your computer. When the “localhost refused to connect” error appears, it is likely due to misconfigured port. Other common reasons include insufficient permissions and the Apache webserver not running properly.


1 Answers

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 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 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:\Windows\System32\drivers\etc\hosts

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.

like image 97
Tariq Khan Avatar answered Sep 19 '22 13:09

Tariq Khan