No Description

Loweel 36fbae1793 Removed Drone 2 months ago
.gitignore c69717d97b Adding db file 4 months ago
00.database.go 92f06999a1 switched to LevelDB because Bolt sucks 4 months ago
00.memory.go 74951ec76e garbage Collection improved 4 months ago
01.conf.go a7d5da6261 Optimized choice of dns 4 months ago
01.killfile.go 92f06999a1 switched to LevelDB because Bolt sucks 4 months ago
01.stats.go 92f06999a1 switched to LevelDB because Bolt sucks 4 months ago
02.cache.go b294aa14d8 Typo 4 months ago
LICENSE 99feaf77d5 Initial commit 6 months ago
README.md 079bd0a4b3 Update README.md 4 months ago
adlist_hosts.go 768a1885c1 We don't need so much cuncurrency 4 months ago
adlist_single.go 8bac102323 Less cuncurrency saves memory 4 months ago
config.json 1c1333c1db Using Bolt as database for killfile to gain speed and save inodes 5 months ago
dns-upstream.txt ed956d4c48 Fixed lock in cache 4 months ago
dns_client.go b95555a801 Sleep automated too 3 months ago
dns_handler.go ddbfe4720c Small optimizations 4 months ago
hostfile.go 08789c3656 Better indexing of blacklist sources 5 months ago
main.go a7d5da6261 Optimized choice of dns 4 months ago
urls-domains.txt 692607dcd1 fixed typo 5 months ago
urls-hosts.txt 56290637a9 Bugfix 5 months ago
urls-local.txt 08789c3656 Better indexing of blacklist sources 5 months ago

README.md

zabov

Tiny replacement for piHole DNS filter

Still Work in progress, usable.

Idea is to produce a very simple, no-web-interface , IP DNS blocker.

INSTALL

Zabov requires golang 1.11 or later.

git clone https://git.keinpfusch.net/LowEel/zabov.git
cd zabov
go get
go build

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.

There are two kinds of blacklists:

One is the "singlefilter", where we find a single column , full of domains:

domain1.com
domain2.com
domain3.com

The second is the "doublefilter" (a file in "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.

The config file should look like:

{
    "zabov": {  
        "port":"53", 
        "proto":"udp", 
        "ipaddr":"127.0.0.1",
        "upstream":"./dns-upstream.txt",
        "cachettl": "4",
        "killfilettl": "12",
        "singlefilters":"./urls-hosts.txt" ,
        "doublefilters":"./urls-domains.txt", 
        "blackholeip":"127.0.0.1",
        "hostsfile":"./urls-local.txt"
    }

}



Where:

  • port is the port number. Usually is 53, you can change for docker, if you like
  • proto is the protocol. Choices are "udp", "tcp", "tcp/udp"
  • ipaddr is the port to listen to. Maybe empty, (which will result in listening to 0.0.0.0) to avoid issues with docker.
  • upstream: file containing all DNS we want to query : each line in format IP:PORT
  • cachettl: amount of time the cache is kept (in hours)
  • killfilettl: refresh time for killfiles
  • singlefilters: name of the file for blacklists following the "singlefilter" schema.(one URL per line)
  • doublefilters: name of the file, for blacklists following the "doublefilter" schema.(one URL per line)
  • blackholeip: IP address to return when the IP is banned. This is because you may want to avoid MX issues, mail loops on localhost, or you have a web server running on localhost
  • hostsfile: path where you keep your local blacklistfile : this is in the format "singlefilter", meaning one domain per line, unlike hosts file.

TODO:

  • caching
  • monitoring port