Skip to content

royarisse/bind-sinkhole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bind Sinkhole

Block ads, nsfw and tracking by generating a zones file which you can include in your bind9 config.

Install

  1. Clone repository into a folder on your server;
  2. Run the install.sh, it will:
    • Install the cronjob to /etc/cron.daily/bind-sinkhole;
    • Copy /etc/bind/hosts.allow and /etc/bind/hosts.block;
    • The cronjob generates /etc/bind/zones.blocked;
  3. Change your named.conf.local to include the zones.blocked, for example:
options {
  forwarders {
    1.1.1.3;
    1.0.0.3;
    208.67.222.123;
    208.67.220.123;
  }

  forward only;
}

include "/etc/bind/zones.blocked";

Usage

When installed, there will be two configuration files:

  • /etc/bind/hosts.allow;
  • /etc/bind/hosts.block.

These files can be changed, adding one domain or subdomain per line. These files will then be used by the cronjob to generate the /etc/bind/zones.blocked file. Optionally, you can run the cronjob manually to update the zones file:

/etc/cron.daily/bind-sinkhole

Alternative: Use views

Using views allows you to include specific zone files (and forwarders) based on client IP. You can manually add extra zones.* files if you want to.

acl work {
  1.2.3.4;
}

# Filter everything distracting
view strict {
  match-clients {
    work;
  };

  include "/etc/bind/zones.rfc1918";
  include "/etc/bind/zones.blocked";

  forwarders {
    1.1.1.3;
    1.0.0.3;
    208.67.222.123;
    208.67.220.123;
  };

  forward only;
};

# Default / fallback zone: free for all
view nofilter {
  include "/etc/bind/zones.rfc1918";
  include "/etc/bind/named.conf.default-zones";

  forwarders {
    1.1.1.1;
    1.0.0.1;
  };
};

About

Bind DNS sinkhole to block bad sites, ads and more

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages