Tiny, single executable, easy to docker, replacement to piHole AD Block DNS filter.
Tiny replacement for piHole DNS filter
Still Work in progress, usable.
Idea is to produce a very simple, no-web-interface , IP DNS blocker.
Zabov requires golang 1.13 or later.
- git clone https://git.keinpfusch.net/Loweel/zabov.git
- cd zabov
- go get
- go build -mod=vendor
Then, edit config.json: please notice config.json must be in the same folder of the executable you run.
Just a few words about “singlefilters” and “doublefilters”:
Data must be downloaded from URLs of blacklist mantainers.They may come in different formats.
There are two kinds of blacklists:
One is the format zabov calls “singlefilter”, where we find a single column , full of domains:
- domain1.com
- domain2.com
- domain3.com
The second is the format zabov calls “doublefilter” (a file in “/etc/hosts” format, to be precise), where there is an IP, usually localhost or 0.0.0.0 and then the domain:
- 127.0.0.1 domain1.com
- 127.0.0.1 domain2.com
- 127.0.0.1 domain3.com
This is why configuration file has two separated items.
Minimal config file should look like:
- {
- "zabov":{
- "port":"53",
- "proto":"udp",
- "ipaddr":"0.0.0.0",
- "cachettl": 1,
- "killfilettl": 12,
- "debug:"false"
- },
- "configs":{
- "default":{
- "upstream":"./dns-upstream.txt",
- "singlefilters":"./urls-domains.txt",
- "doublefilters":"./urls-hosts.txt",
- "blackholeip":"127.0.0.1",
- "hostsfile":"./urls-local.txt",
- "cache":true
- },
- }
- }
Global zabov settings:
configs:
Advanced configuration includes support for multiple configurations based on IP Source and timetables:
- {
- "zabov":{
- "port":"53",
- "proto":"udp",
- "ipaddr":"0.0.0.0",
- "cachettl": 1,
- "killfilettl": 12,
- "debug":"false",
- "timetable":"tt_default"
- },
- "localresponder":{
- "responder":"192.168.178.1:53",
- "localdomain":"fritz.box"
- },
- "ipaliases":{
- "pc8":"192.168.178.29",
- "lg-tv":"192.168.178.10",
- "localhost":"127.0.0.1"
- },
- "ipgroups":[
- {
- "ips":["localhost", "::1", "192.168.178.30", "192.168.178.31", "pc8"],
- "cfg":"",
- "timetable":"tt_children"
- },
- {
- "ips":["lg-tv"],
- "cfg":"tv",
- "timetable":""
- }
- ],
- "timetables":{
- "tt_children":{
- "tables":[{"times":"00:00-05:00;8:30-12:30;18:30-22:59", "days":"Mo;Tu;We;Th;Fr;Sa;Su"}],
- "cfgin":"children_restricted",
- "cfgout":"default"
- }
- "tt_default":{
- "tables":[{"times":"8:30-22:30", "days":"Su"}],
- "cfgin":"children",
- "cfgout":"default"
- }
- },
- "configs":{
- "default":{
- "upstream":"./dns-upstream.txt",
- "singlefilters":"./urls-domains.txt",
- "doublefilters":"./urls-hosts.txt",
- "blackholeip":"127.0.0.1",
- "hostsfile":"./urls-local.txt"
- },
- "children":{
- "upstream":"./dns-upstream-safe.txt",
- "singlefilters":"./urls-domains.txt",
- "doublefilters":"./urls-hosts.txt",
- "blackholeip":"127.0.0.1",
- "hostsfile":"./urls-local.txt"
- },
- "children_restricted":{
- "upstream":"./dns-upstream-safe.txt",
- "singlefilters":"./urls-domains-restricted.txt",
- "doublefilters":"./urls-hosts-restricted.txt",
- "blackholeip":"127.0.0.1",
- "hostsfile":"./urls-local.txt"
- },
- "tv":{
- "upstream":"./dns-upstream.txt",
- "singlefilters":"",
- "doublefilters":"",
- "blackholeip":"127.0.0.1",
- "hostsfile":"",
- "cache":false
- }
- }
- }
Global zabov settings:
localresponder:
ipaliases: a dictionary of IPs
timetables: a dictionary of timetable dictionaries
ipgroups: an array of ipgroup dictionaries
Multistage Dockerfiles are provided for AMD64, ARMv7, ARM64V8
NOTE: you shall use TZ env var to change docker image timezone. TZ defaults to CET.