for example, assume I have edited the hosts file with the following line:
if I happen to have installed a browser developed by people who owns this malicious website.
EDIT: OK I see this attack model is not very sane, let's imagine a browser exploit in a neutral browser instead.
EDIT: Somehow I discovered that in Chrome/Chromium the browser would not honor hosts under certain circumstances (such as when configured to use a proxy). that's causing the irregular behavior.