Today I lost 1 hour trying to understand why the settings from my 'hosts' file were ignored on a 'Windows 2000' machine. When I was faced with this problem I tried the following but without success:
The solution to this problem is not found in the file itself but in the registry. The registry key
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
points to the location of the 'hosts' file. Since some program from my workstation has altered this registry key, the default hosts file was completely ignored. If you will find the same situation on your machine it is possible that some Adware/Spyware has been installed on your machine. This kind of application will attempt to disable the 'hosts' file because some people use this file in order to cancel all the connections to some hosts with bad reputation.
How to enable the hosts file (step by step)
Note:
%SystemRoot%\system32\drivers\etc
All the above information can be found on Microsoft's web site.
This is a big file: finding the useful information took me about 1 hour. If you are a real geek you are welcome to take a look by yourself :). Search for the word "DataBasePath" in order to find the relevant section.
Observation:
Ad blocking using the windows host file seems to be very easy to circumvent because any program can modify the registry settings (this is possible because the majority of windows users are running their PCs in administrator mode)
If you wish to add something feel free to use the forums.