Why is Chromium bypassing /etc/hosts and dnsmasq?

The majority of references about this subject are old. If you have an old version of Chromium, follow edvinas.me answer.

For current versions of Chromium (at the time this post was written: 33rd), here is what you should do:

  1. Go to chrome://settings
  2. Click on "Show advanced settings..."
  3. Unmark the Predict network actions to improve page load performance box.
  4. Check if the DNS prefetching is really disabled by going to chrome://dns. You should see there something like DNS pre-resolution and TCP pre-connection is disabled. If the prefetching is not disabled, you'll see some tables there.

Update

For newer versions of Chrome (at the time of this update: 55th), the third item is worded as: Use a prediction service to load pages more quickly.

Reference

  • http://www.chromium.org/developers/design-documents/dns-prefetching

Updated Answer

Make sure you clean Chrome's cache. Type this in address bar:

chrome://net-internals/#dns

Then click Clear host cache button.

Old Answer

Chromium is using Google's internal DNS by default (8.8.8.8 and 8.8.4.4)

To disable it:

  1. Click on Tools menu (a little wrench icon), then go to Options.

  2. ‬Click on the Under the Hood tab.

    ‪3. ‬Under “Privacy” section, untick the check box for Use DNS pre-fetching to improve page load performance.

    ‪4. ‬Click on the Close button.

    ‪5. ‬Refresh to reload the web page.


One other obscure possibility is that your system is setup to use an automatic proxy *.pac file. This would normally be the case if you were issued a computer in a corporate environment and the *.pac file is telling your browser to go through a proxy to resolve the URL. This takes priority over your /etc/hosts file and if the *.pac file has a rule in it to return PROXY if nothing matches then it will appear that Chrome is not honoring the /etc/hosts. This will normally be the case if your command line is working as expected, e.g. dig, ping etc.

If you tried the other solutions and they don't work then check to see you don't have an auto proxy setup that Chrome is using.