#IT – Blocking Websites Using The Hosts File

If you want to stop access to certain websites there are many ways to achieve this. One of them is through the HOSTS file on a Windows machine.

On Windows 7 you can find it in

If you go to search and look for


you should find a file without an extension. Open it up in Notepad and you will see that you can add to the end of the file.

An example would be localhost http://www.facebook.com http://www.twitter.com

This can be useful for restricting access to certain websites on specific machines/devices and also you could use this trick to actually block most ad sites so that you don’t need to run things like AdBlock Plus.

Parents might find it useful to protect younger eyes from the darker corners of the internet also.
No filter or censorship will ever make up for good parenting though so I’d say it’s always better to educate them rather than trying to restrict them hoping that will be enough.

Most routers (even ISP provided devices) allow for certain filters etc to be applied to the router but kids are more resourceful than you think and most know they just need to factory reset the router back to defaults. This hosts method means that they may not realise where the block actually is.

I honestly don’t know if similar things can be done on Android, UNIX etc but I wouldn’t be surprised if it is also possible on Linux distros and maybe even Mac OS X


About Shut Up Nerd!

This entry was posted in IT and tagged , , , , , , , , , , , , , . Bookmark the permalink.


Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s