diff options
| author | Max Resnick <max@ofmax.li> | 2025-03-03 22:07:17 -0800 |
|---|---|---|
| committer | Max Resnick <max@ofmax.li> | 2025-03-03 22:07:17 -0800 |
| commit | e179d1c3d7f592413019adf839992754a30d564d (patch) | |
| tree | d2a9bb34213e4956418d82ba94ff03fee02a2e5d | |
| parent | e31be2ef1be5745e4af74def945e694ea1bd4fe9 (diff) | |
| download | unbound-adblock-config-e179d1c3d7f592413019adf839992754a30d564d.tar.gz | |
docs: update info on the tool
Diffstat (limited to '')
| -rw-r--r-- | README.md | 74 |
1 files changed, 74 insertions, 0 deletions
@@ -64,3 +64,77 @@ go build ```bash go test -v ``` +# unbound-ads + +A tool to generate [Unbound DNS server](https://nlnetlabs.nl/projects/unbound/about/) configuration for domain blocking. It fetches domain lists from URLs and converts them into Unbound's local-zone configuration format for DNS-based ad and malware blocking. + +## Features + +- Fetches domain lists from multiple URLs +- Supports various domain list formats (hosts file format, plain domain lists) +- Deduplicates domains automatically +- Generates Unbound-compatible configuration +- Progress logging with slog +- Docker support + +## Installation + + +### Using Docker + +```bash +docker pull public.ecr.aws/s0f9o2k5/unbound-ads:latest +``` + +## Usage + +### Binary + +```bash +unbound-ads <url-list> <output-file> +``` + +Where: +- `url-list` is a URL containing a list of domain list URLs (one per line) +- `output-file` is the path where the Unbound configuration will be written + +Example: +```bash +unbound-ads https://v.firebog.net/hosts/lists.php?type=tick blocking.conf +``` + +### Docker + +```bash +docker run --rm -v "$PWD:/data" ghcr.io/yourusername/unbound-ads \ + https://v.firebog.net/hosts/lists.php?type=tick /data/blocking.conf +``` + +## Building from Source + +Requirements: +- Go 1.21 or later +- just command runner +- Docker (optional) + +```bash +# Build binary +just build + +# Build Docker image +just docker-build + +# Run tests +just test +``` + +## Output Format + +The tool generates Unbound configuration in this format: + +``` +local-zone: "example.com" refuse +local-zone: "ads.example.com" refuse +``` + +When added to your Unbound configuration, these entries will cause Unbound to return NXDOMAIN for queries to blocked domains. |