Modifying /etc/hosts does not have an effect

Solution 1:

You'll find the browsers and the system will cache things for you. In order to get this to apply right off the bat you should make sure to clear caches and restart your browser. In order to test this out, try performing a dns check from a terminal such as

ping bing.com

You should get it replying back from 127.0.0.1. If this works then your hosts file change is good, but it's just cached in your browser.

Solution 2:

Have you tried putting the 127.0.0.1 entries on the same line?

120.0.0.1 abc bing.com foo

That should work.