Another day, another reason to hate Windows 8. And I haven’t even installed it yet. According to ghacks.net, using the Windows HOSTS file to block web sites will no longer work reliably in Windows 8.
Modifying the Windows HOSTS file is a simple and effective way to fiddle with the way domain names are translated into IP addresses. I use it on development PCs to allow access to locally-hosted web sites using their public URLs. It can also be used to redirect unwanted web sites to LOCALHOST, effectively blocking them. This can be used as a rudimentary form of ad blocking, although there are some risks involved.
Microsoft apparently doesn’t want people using the HOSTS file that way, because it silently updates the file, even if it’s marked as read-only, removing entries for facebook.com and ad.doubleclick.net (a major advertising source), and presumably others.
It turns out that the culprit is Windows Defender, which is enabled by default in Windows 8. Exactly why Windows Defender is doing this is not certain, but it’s safe to assume that Microsoft was pressured to do this by Facebook, Doubleclick, and others. Microsoft will probably claim that it was done for reasons of security, in which case it will be interesting to hear their explanation.
Meanwhile, disabling Windows Defender apparently resolves this issue. You should probably use real anti-malware software anyway. There are plenty of free alternatives.