Block ads, tracking and other garbage with dnsmasq

There is an automatically updated, moderated and optimized list available on GitHub for blocking ads, trackers and other online garbage:

The list is designed for use with dnsmasq. There is also a validation script available at You can configure automatic update of the list by following these steps:

    1. Install Node.JS that is a requirement for the notracking validate script:
      $ curl -sL | sudo -E bash -
      $ sudo apt-get install -y nodejs
    2. Clone the notracking repository:
      $ cd /opt/
      $ git clone git://
    3. Configure crontab to download updated lists on a daily basis by creating the file /etc/cron.d/notracking with the following content:
      0 6 * * * root cd /opt/notracking;./update;mv /opt/notracking/*.txt /etc/dnsmasq.d/;/usr/sbin/service dnsmasq restart
    4. Disable the CONFIG_DIR option in /etc/default/dnsmasq by comment out the following row:
    5. Add these two lines to the file /etc/dnsmasq.conf:

To get the configuration running immediately you can manually execute the commands from the cronjob or you can wait for it to run by it self at 06:00 the morning after you configured dnsmasq.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website with
Get started
%d bloggers like this: