This guide shows you how to overcome Windows 8 default setup to block websites using the hosts file.

About The Hosts File

An easy way to block websites on Windows is to use the hosts file. A hosts files allows you to resolve domain names such as or to other IP addressess. This means if it is altered directly it can redirect users to a different website or warning message and is often used by work places to block websites such as Facebook.

Click here to join - Rare NFTs and Play-to-Earn Games or Read my review first!


There are obvious security risks with tampering with the hosts file also and this is one of the reason that Windows 8 disables editing by default due to Windows Defender antivirus set up.

This guide shows you how to edit the Windows 8 hosts file and is geared more for the tech savy readers out there. It should be carried with due caution.

Step By Step

1. Step

The first thing you will need to do is access Windows Defender settings to alter the default setup.Windows Defender has replaced Microsoft Security Essentials in Windows 8.

There are two options here – Exclude the hosts file from being monitored in Windows Defender or Install a Third-Party Antivirus.

Excluding the hosts file from Windows Defender means you can still avail of all the inbuilt security features while gaining access to your hosts file. The second option is of course dependant on the third party software you install and they tend to be less restrictive on the hosts file editing protectionism that is featured in Windows Defender.

2. Step

To start – press the windows key and search for Windows Defender. Next click on the Settings tab and excluded files and locations category.

Search for this file …


3. Step

Click on the Add button before selecting Save changes. This will allow you to know edit the hosts file to your own preferences without any restrictions.

4. Step

To actually edit your hosts file you will have to do it under an administrator account first of all. If you simply double click it on the file you will be instantly denied permission.


The way around this is to launch Notepad.exe as an administrator. Simply right click on the program and select “Run as administrator”.

Note – any other text editor such as Notepad++ will also work here.

5. Step

Once you have your text editor open as an administrator then simply open up the hosts file under the same folder you had previously accessed it.

6. Step

To actually block any websites you simply add a line for each one starting with


For example if you would like to block it would look like this –

7. Step

Once you make the changes you need simply save and they will take immediate effect. There is no need for a restart or browser restart and the website information you submitted should be already set up to be redirected or blocked.


If you are comfortable with editing your computers hosts file it is a great way to enhance the security of you computer if you are in a public environment, family or work setting. It is also a great way to increase productivity for you or your team by block off the traditionally “timesink” websites such as Facebook etc…

Like with editing any Windows file it should be done with caution but by following the steps outlined here you should be in a good position to comfortably alter your Windows 8 hosts file directly from your operating system.