Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old December 30th, 2005   #1
anil_robo
Dipped in Ubuntu
 
anil_robo's Avatar
 
Join Date: Oct 2005
Location: Aldan, PA
Beans: 564
Send a message via MSN to anil_robo Send a message via Yahoo to anil_robo Send a message via Skype™ to anil_robo
Cool How to block internet advertisements, banners and spyware in Linux

Hi all! I'm seeing heated discussions on spyware for linux, and I think it's a well-suited time to post a useful tutorial here. By following these simple steps, you will be able to block most advertisement banners on webpages, virus-infected websites, spyware-infected websites, and other insecure websites.

Theory: In Linux, the file /etc/hosts contains information about how the system interprets website domain names. If you want to block a website, just make it point to 0.0.0.0 (e.g. www.site-to-be-blocked.com will point to 0.0.0.0 => The site won't open at all!).

How to: First, you need a good hosts file to install. The one I use is here.
Click on that link right now, and the file will open in a browser or a text editor. Select all the text in the file, and copy it.

Now open a terminal, and type
Code:
sudo gedit /etc/hosts
. Your hosts file should open up. This file may already have some entries in it, which we're not going to change. Go to the end of the file, and "paste" the contents of the hosts file you had copied to the clipboard earlier.
Save the hosts file, and it should be active. Just to be more sure, you might want to logout and relog to Ubuntu.

Now when you start browsing, you'll not see any ads, rather they'll simply fail to load! Here's a screenshot when I try to access an advertisement site (www.doubleclick.net):
Screenshot-Problem loading page - Mozilla Firefox.png

A lot of people have recommended using adblock extension for Firefox instead of this hosts-file blocking method. Adblock protects you against spyware/adware when you're surfing the internet through Firefox. But what about the other malicious things you can get through other programs? For example, in your email which you view through evolution? Since evolution accesses internet directly, I'd still go for blocking all the parasites through the hosts file.


This method does not work if you are using a proxy.

The host file structure changed with Ubuntu 8.10, so I doubt the same hosts file will work for Intrepid.
__________________
P-166MHz, 64MB SMRAM, 1GB HD hosting websites
My blog

I'm registered Linux User # 406032

Last edited by anil_robo; December 13th, 2008 at 06:15 AM..
anil_robo is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:27 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry