Page 1 of 11 123 ... LastLast
Results 1 to 10 of 107

Thread: How To Block Ads And Spyware In Linux

  1. #1
    Join Date
    Oct 2005
    Location
    Aldan, PA
    Beans
    552

    Cool How To Block Ads 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):
    Click image for larger version. 

Name:	Screenshot-Problem loading page - Mozilla Firefox.png 
Views:	2758 
Size:	69.9 KB 
ID:	4963

    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.
    Last edited by anil_robo; December 13th, 2008 at 11:15 AM.
    Photography by Indians
    I'm registered Linux User # 406032

  2. #2
    Join Date
    May 2005
    Location
    Kotka
    Beans
    56
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: How To Block Ads And Spyware In Linux

    Sounds good,thanks for Howto. I have to try this
    Registered Linux user #389834

  3. #3
    Join Date
    Dec 2005
    Location
    Sweden
    Beans
    39
    Distro
    Ubuntu 6.06

    Re: How To Block Ads And Spyware In Linux

    Very nice How To
    Linux user #406037
    If you speak swedish take a look at my webased game www.dackbrann.net

  4. #4
    Join Date
    Sep 2005
    Beans
    146

    Re: How to block internet advertisements, banners and spyware in Linux

    You're using Firefox. Just install AdBlock.
    There's even a Filter Updater extension for AdBlock, too, that'll auto-update when the list changes.

  5. #5
    Join Date
    Jun 2005
    Beans
    33
    Distro
    Kubuntu 6.10 Edgy

    Re: How to block internet advertisements, banners and spyware in Linux

    Quote Originally Posted by guice
    You're using Firefox. Just install AdBlock.
    There's even a Filter Updater extension for AdBlock, too, that'll auto-update when the list changes.
    AdBlock is probably my favorite extension, along with the updater. I've been using Konqueror a lot more lately, too, so I exported the blocked sites list from Firefox to a file, and imported that into Konqueror's built-in adblock feature. It makes surfing the web so much more enjoyable.

  6. #6
    Join Date
    Nov 2005
    Location
    Canada
    Beans
    137
    Distro
    Kubuntu Breezy 5.10

    Re: How To Block Ads And Spyware In Linux

    Related to this subject,
    If anyone noticed in firefox when you do about:config in browser address, filter: dns -- network.dns*=.doubleclick.net, change the value to true! (stay out of their dns)
    Last edited by limit223; December 31st, 2005 at 07:58 PM.
    ...optimize, clarify, open, Share....knowledge.

  7. #7
    Join Date
    Jan 2005
    Location
    Toronto, Ontario, Canada
    Beans
    2,204

    Re: How To Block Ads And Spyware In Linux

    this could be used as a nanny lock to no?
    Edward A Robinson -- www.earobinson.org

  8. #8
    Join Date
    Nov 2005
    Location
    Canada
    Beans
    137
    Distro
    Kubuntu Breezy 5.10

    Re: How To Block Ads And Spyware In Linux

    well..it said that was implemented for speed but if you choose any other dns: mozilla.org , google would return no search.... True value works fine.
    ...optimize, clarify, open, Share....knowledge.

  9. #9
    Join Date
    May 2005
    Beans
    66
    Distro
    Ubuntu 6.06

    Re: How To Block Ads And Spyware In Linux

    This just seemed to slow a lot of sites down for me. I took it back out of my host file and everything seemed to speed up again.

  10. #10
    Join Date
    Apr 2005
    Beans
    645
    Distro
    Dapper Drake Testing/

    Re: How To Block Ads And Spyware In Linux

    its normal to slow down sites that use one of the addresses u blocked, since your browser will keep trying a bit to connect to localhost untill it time out!!
    [My Blog] | [My Sites] | [My Ubuntu Guides]

    doc.gwos.org, the real successor of Ubuntu Guide

Page 1 of 11 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •