Google Chrome ignores hosts file

Google Chrome ignores the settings in the file C: /Windows/System32/drivers/etc/hosts . Both IE11 and Firefox are installed on the same machine and work as expected.

I tried all the solutions I could find on the Internet, including:

  1. Open chrome://net-internals/#dns and click the "Clear Host Cache" button.
  2. Go to "Settings", "Show advanced settings" and uncheck the following three options: (X) Use the web service to fix navigation errors (X) Use the prediction service to help you search and the URLs entered in the address bar (X ) Using the forecast service to quickly load pages
  3. Go to "Settings", "Show advanced settings", click the "Clear Browser Data" button, first select "Cached Images and Files" and click "Clear Browser Data".
  4. Restart Chrome.exe.
  5. Reboot the computer.
  6. Be sure to add http:// to the top of the web address.
  7. Make sure proxy settings are off
  8. Run cmd.exe and run ipconfig/flushdns
  9. Uninstall and reinstall Chrome

I'm at a loss ... I missed something, what can I try or check?

+35
source share
7 answers

Chrome doesn't seem to like the following extensions for this kind of thing:

 .dev .localhost .test .example .app 

Use .local and the problem seems to go away.

+16
source

Try flushing the DNS cache:

1) run cmd.exe as administrator

2) Type: ipconfig / flushdns

+5
source

I have the same issue for Chrome for Ubuntu Linux. I use a proxy server, and instead of checking / etc / hosts, Chrome prefers checking DNS proxies.

+5
source

Ok, I ran into the same problem, but then I found a solution. Try this: Go to History ( Ctrl + H ) โ†’ In the left pane, click " Clear Browsing Data." In the new window that opens, go to the " Advanced " tab. Set the time interval to " All time" โ†’ check the box " Cached images and files" โ†’ click " Clear". data Restart the computer, it should start redirecting the addresses specified in the Hosts file (C: \ Windows \ System32 \ drivers \ etc \ hosts)

Note. This solution is for Google Chrome only.

+3
source

This was identified as a โ€œbugโ€ in Chrome, but it seems to be absolutely deliberate behavior. Google Chrome does not consider /etc/hosts when connecting to the internal. It always does a DNS lookup to determine the IP addresses.

Although my links below mostly relate to my experiences with this on Linux, it is not limited to Linux.

https://groups.google.com/a/chromium.org/forum/#!topic/net-dev/iKXqyc40tW0

https://superuser.com/a/887199/75128

https://bugs.chromium.org/p/chromium/issues/detail?id=117655

+2
source

A little late, but after a few hours I find a solution. It seems like Google Chrome sometimes has problems resolving host names defined in / etc / hosts.

I am using Linux and I am behind the proxy.

Try adding at the end of the name server: .localhost

Example:

In: / etc / hosts:

 127.0.0.1 myservername.localhost 

On the virtual hosts of your server configuration, you need to rename the server name. In my case, I use apache, so in /etc/apache/sites-enabled/myserver.conf rename the line of the old server name with:

 ... ServerName: myservername.localhost 

If you are behind a proxy server, you can, apart from all hosts, just add vars no_proxy:

 $no_proxy= "localhost" 

Finally, do not forget to restart the server and try to enter the browser with the new server name.

+1
source

While it was stated that the proxy server was not in use, I had the same problem with OS X when using the proxy server, and eventually a proxy exception was added for this domain.

What OP can try is to disable asynchronous DNS using the command line as mentioned here in 2015:

Async DNS: remove the switch from approximately: flags

Async DNS is currently pretty stable, so we really don't need to switch to: flags anymore. (Note that --enable-async-dns and the command line flags --disable-async-dns will still work.)

This, however, seems to have no effect in my case, since chrome://net-internals/#dns still displays the internal DNS client as enabled without an obvious way to disable it.

0
source

Source: https://habr.com/ru/post/1265115/


All Articles