Block A Website on Windows [No Software]

Hello Everyone, Welcome to GEEKS UNBOXED .In this post you will be learning about how can you can easily block a website on a Windows Computer without using any external software.


Do you want to block your kid from using facebook ?

Or Have you ever wanted to block a website on your computer ?

Do you want to play a prank on your friend by blocking some websites ?

Or Do you want to block some adult content on a computer ?

If the answer to any of the above questions is YES ! , we got you covered. After going through the following tutorial, it would be a very easy task for you to blacklist/block any website or IP Address on any computer.

Important : You need Administrator rights on a computer for this tutorial.

The only tools you will be needing are :

  • Administrator Rights
  • Notepad

The Insights :

In this process, what we do is that we force the Web Browser or any other client trying to reach a website by redirecting it to local loopback ie 127.0.0.1 . Local loopback IP is a special IP address of your own computer (always ) .So if a server is running on your computer, it will be accessible via this IP Address. Also if you ping this IP, you will always get a response even if you are not connected to internet. So basically this is self-IP of any computer.

block a website_ping

 

The hosts file is a plain text file without any extension, it allows us to manually assign host names to IP Addresses. So , logically if you ask gmail.com to get the webpage from your own computer, then it makes no sense, cause there is no such thing on it. This is what we follow.

Here is an example of what would a browser show if someone tries to reach a blocked website.

 

block a website_sitepreview

If you want to see how will the page look on your computer, click this Link

Advanced users already know how to customize this page, but that is out of the scope of this post.The steps to be followed are pretty much simple, and there are only few steps to be followed. So lets begin,

Steps to BLOCK a WEBSITE on your COMPUTER :

  • Go to “C:\Windows\System32\drivers\etc” .Right click on the file named ‘hosts’ and select properties from the drop down list.

block a website_dropdownmenu   block a website_properties

  • Uncheck the box beside the text “Read only”.
  • Head over to Start Menu, search for notepad (windows 10) (or go to notepad) , right-click it and choose ‘Run as Administrator’ .Windows may ask you to confirm administrator privilege, press Yes.

block a website_notepad

  • Now you will get a Notepad window with administrator privileges .This is important because without those privileges, you won’t be able to edit the file in next steps.
  • Go to File > Open or press Ctrl + O.

[sociallocker]

  • This will open a new Window, navigate to “C:\Windows\System32\drivers\etc” and in the box which says “Text documents” , click on it and choose  “All Files” from the list.

block a website_save_all block a website_hosts

  • You will be able to see some files in the window, open the ‘hosts’ file from the list.
  • The file would look similar to this.

block a website_Screenshot (15)

  • Then scroll down to the end of file and add a entry like the image below. The entry is like
127.0.0.1          website.com

block a website_Screenshot (23)

  • This entry will always be the same, i.e. 127.0.0.1 and then the name of website you want to  block. 
  • After this click File > Save or just press Ctrl + S.

block a website_Screenshot

[/sociallocker]

 

  • Now reboot your computer and that’s it. You can check by trying to visit the website.

 


In the same way, if you could add the names of all ad servers, you would be able to block all ads on all web browsers.Seems cool huh  ! I will post a list soon. Do let me know if you have any doubts or some new tutorial, and yeah also comment what website you blocked and why !

Have a nice day !

Liked This Post ?

Think how much you can learn with more such posts..Get updated in your inbox right away.

5 COMMENTS

  1. This is great and i keep coming back to it when searching… but what i need to do is restrict access to the sites as above but for specific users NOT for every user on the PC.. Do you have a fix for this?

LEAVE A REPLY