Using Windows Host File to Access, Block Websites

By Sidharth | How-to

block-websitesYou are not able to access particular website from your internet browser? Or you don’t want your kid to access certain websites online?

Here is a simple tip to access or block websites  with the help of Windows hosts file which is located in your system32 folder of windows. These hostfiles are usually used to map the hostnames to IP address which is supervised under the admin activity.

Block Websites or Access blocked websites

Some people use this trick to block access from specific webpages. If you are not able to access particular websites such as or then check the host files which is located at


For windows 98/95/ME you can access the host file by navigating to:


You will find a file called hosts which can be opened in any free word processors including notepad. Here is how hosts file in windows xp looks like..


Blocking websites – If you observe closely, you can find an example in host file showing on how to block websites. So, consider an example that you want to block Myspace from school or orkut from office then these lines should be added to the host file


The value remains the same as it is your local machine’s IP address. Make sure you include the alternative urls to block the websites ( and to block Myspace). Save the file and close it!

Accessing Websites – If certain websites are blocked from in your computer then check host files and delete the lines of code (ex: and save the file. Try accessing the website using your browser now..

About the Author

Hi, I am Sidharth. Full-time blogger. Editor of Blogote. And a self-proclaimed geek!