Chrome localhost does not work - google-chrome

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:\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.

With the 'chrome' I face the same issue because by mistake I comment out the
127.0.0.1 localhost from the host file, But 'Firefox' will work.
Just make sure your host file include
127.0.0.1 localhost

FIXING
Try contacting your system administrator.
ERR_ICANN_NAME_COLLISION.
if you are using magento and getting such error
just go to you database and search for core_config_data
click on it then check your web store name
change the store name
restart your wamp and fixed.

Worked for me:
chrome://net-internals/#hsts -> Domain Security Policy -> Delete domain security policies -> enter there localhost and press delete

Here is another catch for you, my virtual hosts in Windows hosts file were defined as:
127.0.0.1 bla.bla.bla.localhost
127.0.0.1 bla2.bla2.localhost
And actual server virtual host directives in Xamp Apache Vhosts file made it all work nicely in all browsers, but Chrome!
A simple fix - dont end with full "locahost" word, rename the vhosts to end with anything else, just "loc" did it in my case, all works in Chrome now!

Been having this problem with Version 56.0.2924.87 (64-bit) of chrome, attempting to access a vm by gset.localhost, just would not work.
Changed the url in the hosts file to gset.loc and it works fine.
The answer seems to be do not use localhost in your hosts file urls when attempting to access a virtual machine running on your machine using chrome.

All browsers - chrome, firefox, safari were not resolving my virtual host and kept re-directing to www.mysite.dev
After pulling my hair for hours - it turned out I just need to change mysite.dev to www.mysite.dev in the /etc/hosts file.

Related

Adding 127.0.0.1 to hosts file to redirect locally has error. Says my site “refused to connect.”

I answered this below for anyone that is interested
I'm on Windows 10 using Chrome, Firefox and MS Edge. I'm trying to do something for a class I'm taking and can't get it to work. All I want to do is add something like this to the hosts file:
127.0.0.1 mysite.dev
This is ALL to run on my local PC. I eventually need to have my site able to run on IIS, but this is the first step and I can't get past it. (I'm on my second day trying)
What I've done:
I did edits in notepad on a file on my desktop.
I renamed the original hosts file in the drivers/etc directory.
I copied my file into the drivers/etc directory.
I ran ipconfig -flushdns
I successfully pinged the new site with: ping mysite.dev
I cleared browsing history in all three browsers.
I reopened all three browsers.
All that failed to make any difference (and I rebooted as well) So I added this:
I ran ipconfig -flushdns
Then ipconfig -renew
Then ipconfig -registerdns
Then repeated steps 5->6 and all failed to make any difference. These are the errors per browser:
Chrome: This site can’t be reached mysite.dev refused to connect.
Firefox: Unable to connect Firefox can’t establish a connection to the server at www.mysite.dev.
MS Edge: Hmmm...can’t reach this page
I noticed that all three browsers changed http to https. Not sure if that mattered but I followed instructions to disable this re-direct for all three browsers and NONE of them actually stopped the redirect to https.
And I still can't the correct result, which should be the IIS default page. I can see the IIS default page with localhost, so IIS is running.
Help! Any ideas or directions at all would be very appreciated!
Got the answer from someone. Google owns the .dev domains and has restrictions on it so it HAS to be HTTPS, which requires certs etc, which is not in the scope of my class. I just changed it to mysite.local and BOOM!, there it was! Thanks.

Chrome ignoring hosts file for subdomains of localhost

When I attempt to visit http://mysubdomain.localhost chrome resolves to [::1]80, even if there is an explicit entry for this domain in the hosts file. No other browser behaves this way. Firefox, safari, and curl all resolve the IP address given in my hosts file. This is the entirety of my hosts file at the moment:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
192.168.88.88 mysubdomain.localhost
And yet, when I attempt to visit http://mysubdomain.localhost in chrome, it does not resolve to 192.168.88.88. This is problematic for me, because 192.168.88.88 is a virtual machine running on my computer. I could change the domain to http://mysubdomain.local or http://mysubdomain.dev, but that would require me to update a configuration file used by many people on the project, which I'd rather avoid, because I may break some aspect of their workflow.
Firefox (working as desired)
curl (working as desired)
Chrome (not working as desired)
Some things I've already tried:
I am not using a proxy
I have cleared browser cache many times
I have cleared dns cache from chrome://net-internals/#dns
I have restarted the machine several times
I have cleared the system DNS cache with the terminal command sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
I have tried incognito mode several times
I have tried created a new chrome user account
System information:
Chrome version: 53.0.2785.116
OS Version: Mac OS 10.11.6 (El Capitan)
Upon further review, I think this is unfortunately working as designed. From the chromium issue queue:
This was done as a security mitigation, as OS X's resolver does not properly ensure that .localhost domains are not queried on the network, which is a key security property of ensuring .localhost is truely local. Because we can't trust the resolver to do the secure thing, we unfortunately can't trust the resolver (even when it may be secure)...
The security risk is not about properly configured server vs improperly configured server. It's that a DNS resolver should never send foo.localhost requests out to the network. If it does, a network attacker could make "foo.localhost" point to any IP of their choosing. This is bad, because "localhost" (and "*.localhost") have special privileges (c.f. http://www.w3.org/TR/powerful-features/#is-origin-trustworthy ), and because they have those special privileges, they need to be secure.
In fact, it seems that chrome may be the only tool in the bunch properly implementing RFC-6761 which states in part:
Name resolution APIs and libraries SHOULD recognize localhost
names as special and SHOULD always return the IP loopback address
for address queries and negative responses for all other query
types. Name resolution APIs SHOULD NOT send queries for
localhost names to their configured caching DNS server(s).
So it seems there is no way to fix this. I will change the domain of my virtual machine to http://mysubdomain.local
After playing around with this and using firefox for a while, I found a workaround by accident. Instead of changing your development environments you can simply install https://www.telerik.com/download/fiddler.
Fiddler bypasses the DNS of chrome, I believe, so you are left with a perfectly working system without having to change all your environments.
I have tested this on Windows 10 with Hyper-v over vagrant.

Chrome Ignoring Host File

I am having issues with Chrome and IE.
They are ignoring the Windows hostfile. When I ping the website URL using cmd prompt, it return with the correct IP as per the host file, however when i visit that said URL on chrome, it is going via DNS and not the host file.
Any suggestions on how I could fix this? I have tried clearing caches, flushing DNS etc. This is only happening on one pc, not multiple.
Are you behind a proxy ? The below discussion would help :
https://superuser.com/questions/30197/how-do-i-get-ie-to-use-my-hosts-file-when-using-a-proxy-pac-file
Do you mean "hosts" file?
In Chrome go to chrome://net-internals/#sockets then click "Flush socket pools", from https://www.askmehelpdesk.com/chrome/how-can-set-chrome-use-local-dns-hosts-file-831226.html

Set chrome to ignore hosts file

How can I set chrome to ignore hosts file?
Here is the scenarion:
I have www.example.com site which is Live and customers are using it and now I have got the code hosted on a new server with a host file entry to that server for my domain I am able to browse to the new server. Problem is everytime I want to check whats on live I have to edit my host file entry. So is there an option to manually set one of my browsers ex: Chrome to ignore the host file entry?
HostAdminApp, a Chrome extension, does exactly what you need.
No, I don't think you can, since the hosts file is an operating system wide setting. It would be easier and better to manage if you change the domain of the test server to www.example.local, so www.example.com will go to the live server.
Edit: Another simple solution would be to use a browser in a virtual machine. It could be worth the effort if you need to do a full testing
As it turns out you may be able to use an issue with Chrome to accomplish this. I was having trouble getting Chrome to recognize/use my /etc/hosts file to locate locally defined IPs. It was always doing a search on the name rahter than going to the locally defined domain.
I had to comment out these 2 lines to get it to work:
::1 localhost
fe80::1%lo0 localhost
So, I am guessing that if you put them in, Chrome will ignore your hosts file. It seems it is an issue the Chrome has with IPv6, so as long as you only need IPv4 for the things in your hosts file you may be able to use this Chrome bug to accomplish what you want. At least until it gets fixed...
There is no straight forward solution. The sort of temporary solution is Browser loads host file only when its loaded so I ended up editing the hostfile entry open the browser instance and changed the host file entry back.
So that way the new browser opened will have a new host file entry loaded.
Well, not a solution to the actual problem (force the browser to ignore hosts file), but rather a flexible alternative.
Ok, so what you usually do in your site's configuration is to have a server alias for www.example.com and example.com. So, then you probably enter in your host file something like this 123.231.123.231 example.com where that IP is your new server's IP and you access your site via example.com. Right ?
Well, here's the catch, if you type www.example.com in your browser instead of example.com you will still see the old site, even if you have set alias with www in your new server's configuration. I think you can apply the same trick with http and https, but you get the idea.
Hope this helps.

Chrome & Firefox keep asking for authentication when going to localhost

I'm having a problem where Chrome & Firefox have both started bringing up a popup window saying authentication required when going to localhost (401 page).
If I am on the network I can put in my usual network username/password and it works fine, but if I'm offline (the very reason I'm using localhost) that authentication fails and I get sent to a 403 page.
This does not happen in IE and was not happening a few days ago, my network settings are set to ignore Proxy on localhost and auto detect settings is switched off.
Any ideas?
Problem is the permission of your site directory. If you put the folder under your home (~), then this problem will probably occurs. Try to give your home folder a wider permission. Especially read permission for Others.
sure, if you browse the localhost pure directory you need apache / server authentication
Check your server authentication credentials (user and pass) and this is normal!
while if you browse localhost/mysite you will need not an auth ;)
also be sure your localhost/myproject folder has 755 chmod permissions
finally check if in your localhost/myapp/ there is a .htpasswd file and post it here
I also encountered a similar problem and reinstalling chrome to older version, changing proxy setting didn't help.
I have started using other browsers, however i use the below workaround in case I need to work in chrome.
1.) Click on login without inserting any username and password .
2.) Click on (X) to close the window.
The window would disappear. However, it will reappear if you open any other site or window.