Blocking access to websites is nothing new. For example, you can use Internet Explorer’s content advisor to block access to websites with objectionable content (e.g. pornography, gambling, etc.). But, how to block access to specific websites, not based on content, is not so straightforward. For example, how would a mother with a teenager daughter block access to MySpace? Well, one way is to edit the hosts file. I have written about Windows hosts file in the past. If you are not familiar with the hosts file then read through the article before proceeding.
How does editing the hosts file block websites? Well, Windows always searches the hosts file for a website’s IP address before searching for it on a DNS server. If you change the IP address of an URL, you essentially redirect the web browser to that assigned IP address. A computer’s IP address is 127.0.0.1 (a.k.a localhost). Whenever you change an URL’s IP address to 127.0.0.1, you redirect your web browser back to itself. In other words, it leads to a dead end.
First, create a system restore point just in case things go wrong. Next, you need to download Hoster, a free hosts file manager. Hoster does not need to be installed. Instead, just double click the .exe file and it will launch the manager. Hoster is divided in to two panels. The left panel displays the hosts file, while the controls are on the right panel. If the hosts file is marked as read-only, click [Make Hosts Writable?]. You can make a backup of the original hosts file by clicking [Create Backup Hosts File]. By default, the backup will be saved to the folder which contains the hoster.exe file. Now, you are ready to edit the hosts file. In the blank box, enter the URL of the website you want to block and click [Add to Hosts File]. For example, if you want to block MySpace then you would enter www.myspace.com (without the quotation marks). Repeat these two steps to enter additional sites to be blocked. When you are finished, just exit the program. It is that easy.