If your Ubuntu computer is used by some one else besides yourself, specially children, then you might want to restrict some websites and make sure they do not open on your system. Here is a quick way to block such sites in Ubuntu. It is extremely simple doesn’t require any third party application, you just need to make a simple entry in the /etc/hosts file.
/etc/hosts is a very important file which handles DNS and internet handling on Linux based systems. In order to block some site from opening, open the /etc/hosts file by typing the following command on the terminal:
gedit /etc/hosts
and add the following line:
127.0.0.1 domain.com
Here replace domain.com with the name of the domain that you wish to block.
Now whenever there is an attempt to open the blocked website, the web browser will display the “Failed To Connect” message.
Related posts:

Nice post
[Reply]
Thanks for this helpful infromation and I’ve scraped it with scrapebook(firefox addon) for studying. I am new to ubuntu, can you recommend me books about ubuntu? Thanks.
[Reply]
admin Reply:
January 12th, 2010 at 8:48 pm
Official Ubuntu Book, The (4th Edition)
This is a good one.
[Reply]
Very informative post, great post. Subscribed to feeds
[Reply]
Great Post. Highly impressed.
[Reply]
Very nice post. Do you accept guest writers?
[Reply]
admin Reply:
January 17th, 2010 at 10:13 pm
Yes. Feel free to register and submit your articles.
[Reply]
Please explain it a little more, if possible ? A good, supported
[Reply]
Great site, exactly what I was looking for, I can’t get your RSS feed to work right in google chrome though, is it on my end?
[Reply]
Thanks for the heads up… I might block my fiancée off of perezhilton for a joke… or facebook
[Reply]