dbab – dnsmasq based ad blocking
# start dbab-pixelserv server /etc/init.d/dbab-service start # stop dbab-pixelserv server /etc/init.d/dbab-service stop # get/update ad blocking list /usr/sbin/dbab-get-list # add your own to the ad blocking list /usr/sbin/dbab-add-list
Ad blocking by using DNSmasq + Pixelserv — block accessing to the ad sites from the DNS level. I.e., the DNS server is smart enough to know which sites are ad-sites and block access to them right there. No more user space extensive pattern matching necessary at all.
Comparing to other ad-blocking efforts,
dbab will be super light. Only a few operations are enough to determine and stop the ads. No heavy-lifting (using CPU intensive URL pattern matching) necessary. Thus it will be lighting fast as well.
The advantages of using
- Work at the DNS level. Leave the web pages intact, without any pattern matching, string substitution, and/or html elements replacing.
- Serve instantly. All ads will be replaced by a 1×1 pixel gif image served locally by the
- Maintenance free. You don’t need to maintain the list of ad sites yourself. The block list can be downloaded from pgl.yoyo.org periodically. If you don’t like some of the entries there, you can define your local tweaking that filter them out.
- Easily customized. It’s trivial to add your own entries to the ad blocking list if the existing ones are not enough for you.
dbab-pixelserv is a super minimal web server, it’s one and only purpose is serving a 1×1 pixel transparent gif file. By default it listens on localhost. If you also have a normal webserver on your DNS server, you can
- add a second IP address to your DNSmasq server using a virtual interface, or
- use the virtual hosts option of your local http server to server the 1×1 pixel gif image.
dbab-get-list is used to get dnsmasq blocking list from pgl.yoyo.org to be used by DNSmasq. The result is stored as
You can run it once, or put it in a cron job so as to update the block list periodically. E.g., to update on a weekly basis:
ln -s /usr/sbin/dbab-get-list /etc/cron.weekly/
You can use
dbab-add-list to add your own entries to
dnsmasq blocking list, if the list from pgl.yoyo.org is not sufficient for you. The result is stored as
dbab-chk-list can help you to check if your own list is already covered by pgl.yoyo.org.
- /etc/dbab.addr:The IP address that
dbab-pixelservlistens on. Defaults to localhost.
- /etc/dbab.list-:The entries you want to filter out from the pgl.yoyo.org lists. List sites you still wish to visit there.
- /etc/dbab.list+:The entries you want to add to blocking list on top of the pgl.yoyo.org list, used by
Copyright: 2013~2014 Tong Sun
suntong001 at users.sourceforge.net
The pixelserv was originally downloaded from
Wrote by Piet Wintjens, with BSD (no advertising clause) license.