Search This Blog

Saturday, 12 November 2011

Blocking websites using host file in Windows

Steps To Block Websites In Windows 7

  • Locate Hosts file at
C: > WINDOWS > system32 > drivers > etc
  • Open the hosts file with the help of notepad. In this case we are using Notepad ++.

Quick Tip: Make sure you do this with administrator rights. If you don’t have administrator rights then first right click on notepad and Run it as administrator
  • Now add a line at the end of this file
127.0.0.1     sitename.com
  • If your hosts file already has “127.0.0.1    localhost” then add the sitename after this. E.g.
127.0.0.1 localhost sitename.com

  • Once you are done save the file and now try to access the site which you just blocked with any of your browsers. You will get “server not found” as the error message.
We tested it for twitter.com on 3 browsers – Chrome, Firefox and Safari. Here are the images from these 3 browsers after editing hosts file.
Firefox

Safari
Chrome

This is how you can block websites in Windows 7 by editing hosts file. The blocked site will remain blocked in every browser. There are other methods too as we told you earlier. Some people use the parental control feature of Windows. There are certain software which comes for parental control but we found this one as best method. Try it out and if you have any other method then do share with us. 

1 comment:

  1. Hi,

    I tried this in my system, but i am not getting as you are saying. same thing i passed the site name there which i want to block, but it didn't work in my system. so i want to know what is the problem?
    is your post right ?

    ReplyDelete