How to configure host file to block any website/IP in Windows 8?

To know, how to configure host file to block any website/IP in Windows 8, refer to the tutorial below.

Preview Image

What is windows Hosts file?

Windows Hosts file is One of the less known, but important files included with Microsoft Windows. Hosts file is a simple text file without a file extension. In windows 8 you will find this file in C:\windows\system32\drivers\etc location. Not necessarily C:\, it can be varied according to where you have installed Windows 8. Windows hosts file maps or overrides IP addresses before accessing a DNS (Domain Name Server) . Now a day, the Hosts file plays a more protective role in blocking ads and stopping spyware.

Blocking ad servers and malicious websites is really a tough task. There are many utilities in the market to keep ads blocked, remove malicious spyware, and scan for viruses. Most of this unwanted content comes from known ad servers and known malicious websites. If you can detect these malicious ad servers, you can block these servers using the power of the Windows HOSTS file. Using hosts file you may also trigger on the parental control by enlisting the websites that you want not to access from your computer.

Steps to configure hosts file to block/ unblock any website/ip in Windows 8

Suppose you want to block an ad server or a website ( You need to add a line in your default Windows Hosts file to accomplish this. Follow the steps mentioned below. Following method is true for any website or ad server both. So, can be a particular website or an ad server.
1. First of all navigate to C:\windows\system32\drivers\etc. Here you will see the Windows Hosts file. This file don’t has any extension.

Hosts File

2. Right-click on that file and Open with Notepad. The files will look like this:

Default Hosts File

3. Now, suppose you want to block you need to add the following line in the default hosts file: # ad server for ABCD company

The texts after # sign are comment to identify the site.

Modified Hosts file

4. Now, when your web browser gets a request (request can be made by any adscript, installed on any other website, or it can be direct URL input in address bar) to connect with It will look in the hosts file and will find the entry for the corresponding web address ( Is a universal IP address assigned to the local host (Your computer). So, rather than going to the true IP address of the, the request would stop at your computer and as result the website will not open from your computer (Parental Control) or the ad will not appear (ad blocking).

You can enlist multiple websites or ad servers in hosts file to block the access of those sites from your computer. In each case you need to follow the same process.

Twitter.png Facebook.png GooglePlus.png Pinterest.png LinkedIn.png Tumblr.png Email.png
5 of 5 0 (100%) 1 vote

- Cheers!