My website

Easiest Way To Block Websites

Easiest Way To Block Websites

If you are system administrator at a school, college or office, then you must be looking for a good way to block useless websites like orkut, myspace, facebook, twitter etc. from the computers. Or if you are a parent,then you may want to block certain websites from your computer so that you children don`t open them by mistake.

The best solution would be to use some commercial software to block these websites. Another way would be to configure a proxy filter at the network gateway. Both these solutions are the good ways to block websites. But if you are looking for a cheap solution (read Free) which involves little or no technical expertise, then you can use HOSTS file to block websites.
How To Use Hosts File To Block Websites?
1. Open hosts file in a text editor.

The location of hosts file depend upon your operating system,
  • For Windows NT/2000/XP/2003/Vista/7, it is :- %SystemRoot%system32driversetc host
  • For Windows 95/98/Me, it is %WinDir%
  • For all flavours of Linux and unix, it is located at /etc/hosts
  • For Mac OS 9 and earlier, go to System Folder->Preferences
  • For Mac OS X, it is located at /private/etc/hosts

If you are on windows vista or windows xp, go to click on start->run type,  notepad %SystemRoot%system32driversetchosts  , and press enter.

For other operating systems, simply open the hosts file in any text editor.

2. When the hosts file is open, just look for the line, Localhost

Now under this line, add the names of website that you ant to block, in the following format, WebsiteToBlock

For instance, if you wish to block twitter from your computer, then the following files must be added to the hosts file,

After adding all the websites that you want to block, save the file. Now try to open the blocked websites in your browser. Yes, it works

To unblock the websites again, simply remove those lines from hosts file.