Let’s talk something geeky today. Do you know how to block websites? Hmm, I am not talking about any particular browser or about any specific addon. Can you edit hosts file to block websites in Windows 7? Yea, this is what we will discuss today. Although there are several ways by which you can block websites but I guess if you know this method of editing hosts file on your system then you won’t require any other method ever.
Hosts files are actually system files which without any DNS resolution maps hostnames and IP addresses. So if you want to completely block any particular website then you have to perform some steps. Lets see what are you supposed to do.
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
- 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.
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.