Windows 8 prevents site blocking using HOSTS file

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.

About jrivett

Jeff Rivett has worked with and written about computers since the early 1980s. His first computer was an Apple II+, built by his father and heavily customized. Jeff's writing appeared in Computist Magazine in the 1980s, and he created and sold a game utility (Ultimaker 2, reviewed in the December 1983 Washington Apple Pi Journal) to international markets during the same period. Proceeds from writing, software sales, and contract programming gigs paid his way through university, earning him a Bachelor of Science (Computer Science) degree at UWO. Jeff went on to work as a programmer, sysadmin, and manager in various industries. There's more on the About page, and on the Jeff Rivett Consulting site.

Leave a Reply

Your email address will not be published. Required fields are marked *