Quote of the Day

Tuesday, February 2, 2010

How to Block Websites for all browsers

You might have the knowledge of how to block and unblock selected sites in browsers like Internet Explorer and Mozilla Firefox, but what about blocking specific websites on all browsers? If you block some websites on your computer, nobody can access them through any means unless you decide to unblock them. It's easy, so let's check it out!

The need to block sites arises due to different reasons. Most often parents wish to block those sites that are not appropriate for their children, especially those related to pornography, social networking and gambling. In some instances, the spamming sites and unsecure sites that pose a problem for the frequent surfers can be restricted by blocking the problematic URLs.

All you have to do is explained here.

Go to the Start>Run and type “cmd”. Click on OK so that the Command Prompt Window appears.

In the Command Prompt Window, type “notepad C: /Windows/system32/drivers/etc/hosts” minus the quotes, and hit the Enter key.

You can see the hosts file notepad popped out. In the notepad, you will enter the list of sites that need to be blocked in your system.

Note: An alternate option to access the notepad is to go to My Computer icon and follow the path My Computer>Local Disk (C :) >Windows>system32>drivers>etc to locate the hosts file in etc folder. Right-click on the hosts file and open with notepad.

Once you reach the notepad, find the line 127.0.0.1 localhost from the notepad entries. Below the line, type 127.0.0.1 and after a space, enter the address of the website to be blocked in “www.websitename.com” or “websitename.com” format, depending on the URL of the site.

For example, if you wish to block the site http:// twitter.com, type “127.0.0.1 twitter.com” and in order to block http://www.reddit.com, type “127.0.0.1 www.reddit.com”. Remember to give the exact portion of the URL that comes after “http://” for main domains as well as sub-domains.

In order to block multiple sites, give the URLs of the sites in separate lines, each followed by 127.0.0.1 and it looks somewhat like this. Many sites use the http://www.site.com and http://site.com version of the URLs, so be sure to include both.

127.0.0.1 www.website1.com
127.0.0.1 website1.com
127.0.0.1 www.website2.com
127.0.0.1 website2.com
127.0.0.1 www.website3.com
127.0.0.1 website3.com

Go to the File menu in notepad and select Save to save the file. Now close all the browsers you are using and restart then to check if the blocked websites can be accessed. Type the blocked site’s URL in the address bar of the browser and hit Enter key to see the results. All you can view is an error page or the local web page in your system.

How does it work?

Curious to know how it happens? When you prefix “127.0.0.1” before any site URL, you are redirecting it to your local machine whose IP is 127.0.0.1.

You can also use another known IP instead of 127.0.0.1, to redirect the blocked site to another website. Test it and enjoy the fun!

To unblock the sites just follow the same steps and delete the entries you have entered in the notepad. As you know, it is important to know how to undo it, otherwise you will be trapped!

0 comments:

Post a Comment