Blocking Websites With the Hosts File
A lot of software cracks will usually allow you to run an application which edits your hosts file, usually in an effort to block your computer from accessing the software’s registry server. However, many of these hosts-patching programs have problems or downright fail at editing the hosts file for certain Windows operating systems. The good news is you can patch the hosts file yourself, as long as you know the URL of the site you wish to block or redirect.
Editing the Hosts File (Windows 7)
- Click on the Start (Windows) button
- Click on Computer
- Navigate through Windows Explorer through the following folders:
- C:/
- Windows/
- System32/
- drivers/
- etc
- In “etc” folder, select the hosts file and copy and paste it to your desktop.
- Double click on the hosts file in your desktop
- Select to open it through Notepad
- Make edits to it in Notepad
- Save using Ctrl+S
- Drag and drop the hosts file back into the “etc” folder
- Select “move and replace file” to overwrite the original file
Your hosts file should look something like this:
Blocking Websites
To block a website, you simply add the following to the bottom of the hosts file in Notepad:
127.0.0.1 siteyouwantblocked.com
127.0.0.1 siteyouwantblocked.com
So if I wanted to block MySpace, I would type:
127.0.0.1 myspace.com
And then I would get this if I typed myspace.com into a browser:
127.0.0.1 myspace.com
And then I would get this if I typed myspace.com into a browser:
It will not load the page until I change the hosts file. A lot of people who pirate Adobe software will patch the host file in this same fashion, typing:
127.0.0.1 activate.adobe.com
127.0.0.1 activate.adobe.com
You can patch your hosts file for entirely legal reasons too. Many people will edit their hosts file to block bad or unwanted websites that could harm their computer. In fact,here is a long, extensive list of bad websites that are already prepped to be blocked in your hosts file. Simply download the text document, copy the blocking website codes, and paste it into your hosts file.
However, be sure, if using one of these lists of designed to patch your host file, that all the websites are preceded with the code: 127.0.0.1. That’s an IP address that defaults to nowhere. Just a blank page. If there is any other IP address in the code, don’t trust it. It could be redirecting you to bad sites filled with viruses and terrible things for your computer.