How Block Websites on a Windows Computer

We will see how to block websites on a computer. There is a fine trick to block websites on any computer. This is done by editing the hosts file. The 'hosts' file is used to map host names to given IP addresses. The 'hosts' file is a plain text file that can be edited using text editors. Each line is a redirection entry. Each line should be an IP address followed by a space followed by a host name. When any application software (including browsers) try to connect to a host name (or website) which has an entry in the 'hosts' file, instead of using the domain name service, the IP address is taken from the corresponding entry in 'hosts' file. Then the connection goes to that IP address.

So, if we want to block any website, we only need add an entry for that website in the hosts file with a different IP address. By 'different IP address', i mean any IP other than the original IP of the website. The IP 127.0.0.1 is IP of your own computer. It is called loop back address. You can use this IP to block any website. If you use this IP, the application will try to connect to your own computer on its attempt to access the blocked website and thereby will fail to load the website.

hosts File in Windows

In Windows 7, Windows 8 or 8.1 and Windows 10, the hosts file can be found in the folder:
C:\Windows\System32\drivers\etc\
Here, C: is Windows installation drive.




  1.  In the start menu, locate notepad
  2. Right click on it and select "Run as administrator"
  3. Select File->Open
  4. Navigate to C:\Windows\System32\drivers\etc\
  5. Select "All files" instead of "Text Documents" as file type
  6. Open hosts file
  7. Add a line for each website to be blocked in the format
    127.0.0.0 example.com
To block facebook and myspace, your host file should contain the following lines:
127.0.0.0 facebook.com
127.0.0.0 myspace.com

No comments :

Post a Comment