[Windows 8] How to Edit Windows Hosts file to block websites

Windows 8 presents a whole new approach to computing with all new ways to use Windows. These new features which are meant to take windows to a new era are associated with a learning curve that often leaves a new user confused. Here we would discuss How to edit Windows Hosts file to block websites in windows 8.

What is a Windows Hosts File ?

If you have never came across the term Windows Hosts file here’s a small intro to what a hosts file does. Suppose you are trying to connect to a website on internet, typically you would type its URL in the browsers address bar and would wait for it to open the page. What happens at the other end is that your computer queries a Domain Name Server(DNS) for the address of the website in terms of IP address. DNS returns a IP address. Now your computer will then connect to this numerical IP address and access the site.

For example Techbu.com maps to .The hosts file is a computer file used in an operating system to map hostnames to IP addresses. Host file used to play a large role before the Domain Name System (DNS) came into existence. By editing your local hosts file you can actually change the address that a URL must point to. For example Facebook.com maps to, if you want to block Facebook.com you can typically edit windows hosts file to point it some other address. Typically localhost address, , is used. Doing so computer would try to connect to itself and would not be able to access Facebook.com.

What is the Problem with Windows 8 Hosts file?

When trying to edit Windows 8 Hosts file you would face certain restrictions which are there to increase the security. Quite different to Windows 7 and earlier windows , Windows 8 has a new approach to secure hosts file from malware adding lines of code to it to block websites.When you add certain website addresses to Windows 8’s hosts file, Windows 8 will automatically remove them. It won’t consider any changes made to hosts file. This is monitored by the Windows Defender included with Windows 8. It would monitor your hosts file and would remove any site added to it.

Although a very essential security feature if you want to bypass this security layer here’s how you can.

How to Edit Windows Hosts file in Windows 8 ?

There are two ways to circumnavigate this restriction either you can remove monitoring of hosts file by Windows Defender or you can  use a Third Party antivirus solution and disable Windows Defender  Both the methods essentially do one thing that is to stop Windows Defender from Monitoring your hosts file.

Excluding Windows Hosts file from Windows Defender

# Step 1. Open Windows defender by:  press the Windows key >> type Windows Defender >> press Enter.

windows defender

# Step 2. Navigate to: Settings tab >> select  Excluded files and locations

windows defender hosts file

# Step 3. Click on browse and navigate to C:WindowsSystem32Driversetchosts

 hosts file

# Step 4. Click the Add button and then click Save Changes to save your changes.

windows defender hosts file

# Step 5. Enjoy editing your hosts file.

Windows Hosts file


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.