Log in

View Full Version : How can I set Chrome to use local DNS from hosts file?


Roel Zylstra
Mar 20, 2017, 03:55 PM
I have searched "set chrome to use hosts file (https://www.google.com/search?q=set+chrome+to+use+hosts+file) dns (https://www.google.com/search?num=50&q=set+chrome+to+use+hosts+file+dns)" and "chrome doesn't use hosts file (https://www.google.com/search?q=chrome+doesn%27t+use+hosts+file)" in Google, with results to no avail.

The results returned useless pages like:
https://productforums.google.com/forum/#!msg/chrome/JKcqCOZxwO8/oQYkr-6vKn8J
https://superuser.com/questions/723703/why-is-chromium-bypassing-etc-hosts-and-dnsmasq
https://superuser.com/questions/343158/simulate-manipulation-of-the-etc-hosts-file-in-google-chrome
internet explorer - Chrome Ignoring Host File - Stack Overflow (http://stackoverflow.com/questions/26973357/chrome-ignoring-host-file)
https://www.reddit.com/r/chrome/comments/45s18f/why_does_chrome_ignore_the_hosts_file_on_windows/
https://superuser.com/questions/431983/how-come-hosts-file-redirection-fails
ubuntu 12.04 - How to enable instant host file reading in Chrome? - Stack Overflow (http://stackoverflow.com/questions/15289766/how-to-enable-instant-host-file-reading-in-chrome)

Apparently it does not work on Linux either: https://superuser.com/questions/462676/chrome-does-not-follow-hosts-file.

https://superuser.com/questions/354791/is-there-a-way-to-cause-chrome-ie-firefox-to-reload-the-local-hosts-file-witho/354838 gets close to the answer, but does not quite work. ip - why is my hosts file entry being ignored by the browser? - Stack Overflow (http://stackoverflow.com/questions/37452361/why-is-my-hosts-file-entry-being-ignored-by-the-browser) offers the same answer but acknowledges that
chrome://net-internals/#dns does not work. I also tried the Hosts Switch Plus extension. It did not work for me.

In fact the Chromium project themselves stated they "WontFix" this "feature": https://bugs.chromium.org/p/chromium/issues/detail?id=26545.

How can I most easily accomplish this?

Roel Zylstra
Mar 20, 2017, 04:02 PM
The correct answer appeared when I searched for "flush DNS cache Chrome". The second answer here (https://superuser.com/questions/203674/how-to-clear-flush-the-dns-cache-in-google-chrome/611712#611712) did the trick for me: In Chrome visit chrome://net-internals/#sockets then click "Flush socket pools".

Also, there is an extension named DNS Flusher (https://chrome.google.com/webstore/detail/dns-flusher/nbomnjapnclaocillijpceooehonajnk) that allows the hosts file to be reloaded with one click. Now all I'm waiting for is an extension that reloads the hosts file with no clicks.