Let’s say you want to block certain websites. Maybe to keep your kids off of myspace, for security reasons, or to block advertising from being loaded. You can do this by means of your hosts file. By modifying that little file, you can keep certain websites from being accessed from your computer. Here’s how to do it…
First of all, you must be logged in as a user with administrative privileges.
Then you need to open a text editor with administrative rights. Here’s a simple way to do it.
Hit ALT+F2 to open a ‘Run Application’ dialog box.
Type in… gksudo gedit /etc/hosts
Press Enter, & type in your password, and the file will open.
Add one line to the end of the file for each site you want to block, like this…
0.0.0.0 www.example.com
Note that there is a space between the 0.0.0.0 & the web site address. This will tell you computer to look for www.example.com at the ip address of 0.0.0.0. It won’t be there of course, and they won’t be able to get to the website. This can be done with any site, and with any number of sites. Just keep adding lines to that file. Once you’re finished modifying the file, click the Save button. The changes will take effect upon your next boot up, and the changes will affect every user on the computer. You can even find pre-made hosts file online that will block a lot of advertising that pops up while online.
Here’s what the file should look like if you want to block MySpace & Worldcat…
If you type a line that begins with a “#”, the computer will ignore that line, like my line “# Blocked web sites by How To Ubuntu”

Recent...