:: Re: [DNG] adblocking using /etc/hos…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Adam Borowski
Date:  
À: dng
Sujet: Re: [DNG] adblocking using /etc/hosts
On Sun, Jun 05, 2016 at 09:01:49AM +0200, emninger@??? wrote:
> I wanted to suggest, for the future, may be for a better user
> experience, if it is possible and reasonable to create a small script,
> which would configure /etc/hosts in a way that ad servers and that like
> were redirected to 0.0.0.0 ? May be this could be done in a way that the
> user will be prompted, if (s)he would like to install ad-blocking
> systemwide and also there should be an option to uninstall the created
> list from /etc/hosts .


/etc/hosts allows redirecting only individual hostnames, you'd want to block
whole domains. Also, big /etc/hosts is really slow: the whole list needs to
be loaded from disk, parsed and searched linearly every time you do a
lookup, while a proper nameserver can store the data in an efficient
structure.

A long time ago I made a package to feed such lists to bind:
    https://angband.pl/debian/pool/main/d/dnscruft/
The lists shipped in the package haven't been maintained since 2008, but the
rest should work.  Included script accepts a variety of formats, including
"hosts files".


I haven't used this for a long time, relying on in-browser extensions: lists
maintained by other people, and RequestPolicy which allows third-party
requests on an opt-in rather than opt-out basis, but if you want something
systemwide or networkwide, this might be useful.


Meow!
--
An imaginary friend squared is a real enemy.