Google Chrome

Oliver Fromme olli at lurza.secnetix.de
Wed Sep 10 11:11:37 UTC 2008


David Wolfskill wrote:
 > g1-30(6.3-S)[4] host doubleclick.com
 > doubleclick.com has address 127.0.0.1
 > g1-30(6.3-S)[5] host \*.doubleclick.com
 > *.doubleclick.com has address 127.0.0.1
 > g1-30(6.3-S)[6] 
 > 
 > (My internal resolvers have a file that lists domains where:
 > * they are configured to be masters for the domains in question and
 > * everything resolves to 127.0.0.1.
 > It does clutter the Apache error log a bit, but otherwise tends to speed
 > page loading, as long as one doesn't object too strongly to 404 messages
 > in place of ads.)

If you run a Squid proxy, there's another way to achieve
similar results (without 404 messages).  Put these lines
in your sqid conf:

acl banned_doms url_regex -i "/usr/local/etc/squid/banned_doms.txt"
acl banned_urls dstdomain "/usr/local/etc/squid/banned_urls.txt"
http_access deny banned_doms
http_access deny banned_urls
deny_info ERR_BANNED banned_doms
deny_info ERR_BANNED banned_doms

The file banned_doms.txt contains one domains per line,
for example:

.doubleclick.net
.doubleclick.com
.googlesyndication.com
.hitbox.com
.adserver.org
.usertracker.info

The dot prefix means to include the domain _and_ all
names under that domain, e.g. ".foo.com" includes
foo.com itself as well as www.foo.com, www.bar.foo.com
and so on.  This "dstdomain" matching is very efficient;
in the squid ML someone reported having 600,000 entries
in his file of banned domains.

The file banned_urls.txt contains extended regular
expressions (one per line) that are matched against the
full URL of the request, for example:

^http://wodas\.wetteroffline\.de/static/sky_(google|woshop)
^http://oas\.hiese\.de/RealMedia/ads/

Finally, the file errors/$LANG/ERR_BANNED contains
something like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Blocked</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY><p><em><font size="-1">(Ad blocked)</font></em></p></BODY>
<!--

Thus you will only get a small text "(Ad blocked)" in place
of the ads.  If you don't even want that, remove the text
between "<BODY>" and "</BODY>" completely.  The "<!--" line
is important because it prevents Squid's signature from
being displayed.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Documentation is like sex; when it's good, it's very, very good,
and when it's bad, it's better than nothing."
        -- Dick Brandon


More information about the freebsd-chat mailing list