MacOS – Ping respects hosts overrides – but browsers don’t, in spite of DNS cache flushes

dnshostsmacos

I have a baffling problem. Browsers on my system (10.10.3 Yosemite) don't respect overrides included in my hosts file. This includes Chrome, Safari, and Firefox. I have tried rebooting, clearing history, clearing Chrome's DNS cache with

chrome://net-internals/#dns

and OSX/Safari's with

sudo discoveryutil mdnsflushcache

Chrome sometimes respect it for about 5 minutes at a time after clearing its DNS cache, but then miraculously stops again! And this is not reliable.

Ping through the terminal always respects the changes as it should.

I am completely out of ideas. Anyone?

Best Answer

There are similar problems (i.e. https://superuser.com/questions/648133/why-is-chrome-ignoring-etc-hosts-on-os-x) here on the network.

One answer is to follow this bug which must be solved eventually.

People also mention the plugin HostAdmin to workaround this issue.