How To Block Sites With Hosts File
If you need to block certain sites from being accessible via a web browser here’s a quick solution.
- Click Start -> Run
- Type or Copy the following into the run box-> %SYSTEMROOT%\system32\drivers\etc
- Press Enter -> The Windows Explorer will Open -> Look for the Hosts file
- Open the Hosts file into Notepad (You can do this by dragging the Hosts file into an open Notepad window)
- You should see something that looks like this:

- Add a couple of new lines after the “localhost’. For example, If you want to block google.com from loading -> See Image

- As you can see by the modified Hosts file. I’ve added a couple of new lines. What you are seeing here is the Hosts file re-directing a call to google.com to 127.0.0.1 (this is a loopback IP address in your PC and not an external address) -> This will generate an error page similar to this on your browser when you attempt to surf to google:

- Remember click File -> Save to update your Hosts file after modifying it. Also, you may need to close and relaunch the browser each time you make modifications to the Hosts file.
- Remember to delete these entries if you wish to unblock those sites. enjoy!


Leave a Comments »
Trackback | RSS 2.0
no comments yet - be the first?