diff options
| author | Max Resnick <max@ofmax.li> | 2025-02-28 22:59:23 -0800 |
|---|---|---|
| committer | Max Resnick <max@ofmax.li> | 2025-02-28 22:59:23 -0800 |
| commit | 5680113281aa58b63b1bdd7445a17e281007df23 (patch) | |
| tree | a9e6438086c2fe8f61d44f5d46b358ca9cddabe4 /README.md | |
| download | unbound-adblock-config-5680113281aa58b63b1bdd7445a17e281007df23.tar.gz | |
feat: ad domain parser
Diffstat (limited to '')
| -rw-r--r-- | README.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..b06b0c2 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# Unbound Ads Generator + +A tool to generate Unbound DNS server configuration for blocking advertising domains. + +## Overview + +This program fetches lists of advertising domains from multiple sources and generates a configuration file for the Unbound DNS server to block these domains. It supports multiple input formats and automatically deduplicates domains. + +## Usage + +```bash +unbound-ads-generator <url-list> <output-file> +``` + +Where: +- `url-list` is a URL pointing to a text file containing a list of URLs (one per line) that provide domain lists +- `output-file` is the path where the Unbound configuration will be written + +### Input Format + +The URL list file should contain URLs (one per line) pointing to domain lists. Lines starting with # are treated as comments. + +Example URL list file: +``` +# Ad blocking lists +https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts.txt +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts +``` + +The domain lists can be in either of these formats: +``` +# IP and domain format +0.0.0.0 advertising.example.com + +# Plain domain format +advertising.example.com +``` + +### Output Format + +The program generates Unbound configuration in this format: +``` +local-zone: "advertising.example.com" refuse +local-zone: "another-ad.example.com" refuse +``` + +## Features + +- Supports multiple domain list formats +- Automatically deduplicates domains +- Case-insensitive domain matching +- Progress logging +- Comment handling +- Basic domain validation + +## Building + +```bash +go build +``` + +## Testing + +```bash +go test -v +``` |