How to Block Websites Using Windows Host File

Sunday, 10 April 2016

There are many ways to block any website on a certain computer or network, and Window Host File is one of the best place to add a lineup for blocking websites in all versions of Windows.
I had lot's of issues while maintaining college computers. Many teachers even students complained about students watching YouTube and other entertaining stuff all the time. So I decided to block a few websites using Windows Host File on all computers and it helps but if you are a student and facing any similar situation this post can help you to unblock those websites by editing your computer's host file.

Editing Windows Host File

First of all you will need to be ready with admin access on your machine you want to edit host file for your Windows. You can find Windows host file location by typing %systemroot%\system32\drivers\etc\ nin Windows Explorer's path bar.
Now right click on host file and choose edit option from right click menu. This one will ask you to choose app to open with, choose notepad and proceed.

Add URL or IP address of Website

Now you can add URL or IP address of the website to block it.
For example :-
But instead of blocking websites you can redirect them to useful places, I redirect YouTube to Vimeo videos and useful articles.
To redirect YouTube to any website, add following lines :-
This will redirect YouTube to our website, you can replace website's url. You can get IP of a website by pinging website in command prompt.
Be careful while editing your computer's Windows host file, if you are unable to open as admin then open command prompt as admin and then drag host file in it to open and then save it on the same place (don't forget to change file extension to all and delete .txt after host). You can read more about Windows Host File here.
Copyright ©The Geek Info.
Creative Commons License