Skip to content
Use the BIND DNS server to block ads
Branch: master
Clone or download
Latest commit 3356833 Jun 24, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Updated README Jun 24, 2018

BIND ad blocker

Fetch various blocklists and generate a BIND zone from them.

Configure BIND to return NXDOMAIN for ad and tracking domains to stop clients from contacting them.

Requires BIND 9.8 or newer for RPZ support.

Uses the following sources:


Python packages

These packages need to be installed to run the update script.

Configure BIND

Add the response-policy statement to the BIND options

// For AdBlock
response-policy {
	zone "";

Add your rpz zone. Replace with a domain of your choice.

// AdBlock
zone "" {
	type master;
	file "/etc/bind/";
	allow-query { none; };

Create a zone file for your zone. Replace with the domain you used before.

@ 3600 IN SOA @ 0 86400 7200 2592000 86400
@ 3600 IN NS


usage: [-h] [--no-bind] zonefile origin

Update zone file from public DNS ad blocking lists

positional arguments:
  zonefile    path to zone file
  origin      zone origin

optional arguments:
  -h, --help  show this help message and exit
  --no-bind   Don't try to check/reload bind zone

Example: /etc/bind/ will update the zone file with the fetched adserver lists and issue a rndc reload origin afterwards.


An additional zone can be used to whitelist domains. See Whitelist

You can’t perform that action at this time.