How to Block Websites on your Windows Computer


how to block websites on your computer

The internet is a very vast playground  . It has its advantages and disadvantages . Talking about disadvantages , The internet has become an addiction with children’s and teenagers , Most of them are unaware of their addiction and spend a lot of time surfing online on various sites  . For parents who are concerned about their childrens we have a simple solution to block websites on your computer . lets check out two of the most effective ways to block websites on your computer . The first method to block websites is by editing the Windows hosts file .

How to block websites by editing the Windows Hosts file .

The location of the windows host file depends on your operating system’s version .

For Windows XPVista , Windows 7 and Windows 8 : C:\WINDOWS\system32\drivers\etc\hosts

For Windows 2000 :  C:\WINNT\system32\drivers\etc\hosts

Follow these steps to block websites with this method . For this method we will take Facebook as an example .

  1. Browse the location of the Windows host file
  2. Open the hosts file using the notepad or any text editor .
  3. Find the line  “ localhost”
  4. Add a line “” under the “ localhost” as shown below in the screenshot .

block sites on your computer

  1. Since this method blocks the exact url address you entered in your hosts file . you also need to add another line incase somebody enters without the www “ Facebook” . take a look at the screenshot below for reference .
  2. If you want to block more website then you need to add 1 to the internal ip ( ) and specify the website URL address right next to it with a space . Lets add YouTube to the list of blocked websites . For that we will take “ YouTube” and add it to the hosts file .

editing hosts file to block websites

  1. Save and replace the hosts file in the etc folder without any extension .
  2. No open command prompt by pressing Windows + R key on the keyboard . type “ cmd.exe “without the quotes  in the run window and press enter .

command prompt

  1. In the command prompt type “ ipconfig /flushdns “ and press enter . Now we have successfully blocked facebook and youtube access from your computer .

command prompt flushdns

  1. Reopen any web browser and enter facebook’s url address to confirm . Now the websites specified in the hosts files are blocked .

websites blocked succesfully

If you want to unblock the websites again , simply delete the entries you made earlier and save the hosts file .

But if your childrens are tech savvy they can easily edit the hosts file and unblock the blocked sites . Lets check another method which should not be accessible by your tech savvy childrens  . Further using this method of blocking websites lets you implement the block on multiple devices connecting through your router , which means your childrens cannot access the blocked sites on their cellphones and laptops too .

How to block website using your router or modems configuration settings .

First of all you need to know your router’s login username and password to block websites with this method , The login username and password differs for various manufacturers . Visit Routerpasswords and select your router manufacturer to get the login username and password for your router . Since various routers have different interface we cannot show you how to configure every router to block websites , here are the basics steps that are similar with most routers .

  1. open any web browser you have
  2. enter the ip address “” in the url address
  3. on the login prompt , enter the default username and password of your router . For some routers the default login details are ( username: admin , password: admin ) or ( Username: admin and password: password ). If these doesn’t work then check out for your routers login details .
  4. Navigate to the router’s management options something like , “ access management “ , “Access restrictions”  or “ content filtering “
  5. Once you locate the configuration page , add a certain keyword or website URL that you want to block and save the settings
  6. Restart your router for the settings to take effect and block websites .

You might want to have a look at your Router’s instructions manual which will have the brief descriptions to block websites . Try out the above steps and do let me know of any problems you come across when you block websites . i would reply to your comments as soon as possible .

About the author


Lovejeet is a Proud Geek and tech. enthusiast, who is ardent to learn more about the technology that surrounds us. He loves to tinker around with his gadgets and when he find something new and exciting, he shares it with you on this blog. Last but not the least he is a true gamer by heart. Connect with him on and Twitter

Add comment

By Lovejeet