This utility fetches a curated hosts file, generates Unbound local-data from it, and saves the result in /etc/unbound/local-blocking-data.conf
.
At the moment, only Steven Black's hosts file is used. Source: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts.
This utility is meant to work on Linux. It is untested on Mac, and will probably not work on Windows.
You will want to add include: "local-blocking-data.conf"
to your Unbound config to use the result.
This package is available on crates.io at https://crates.io/crates/tenshi, and the Arch User Respository at https://aur.archlinux.org/packages/tenshi-rs.
Install either rustup or rust
using your favorite package manager.
This utility has been tested to work with Rust 1.34.2.
sudo
is needed if you do not have write access to /etc/unbound/local-blocking-data.conf
.
cargo install tenshi
git clone https://aur.archlinux.org/tenshi-rs.git
cd tenshi
makepkg -i
git clone https://github.com/flacks/tenshi.git
git checkout $(git tag | tail -n 1) # Optional
cd tenshi
cargo build --release
cargo install --path .
sudo tenshi
, excluding sudo
if you have write access to /etc/unbound/local-blocking-data.conf
.
Utility will prompt to continue. For promptless execution, run echo y | sudo tenshi
.
Inspired by https://github.com/gbxyz/unbound-block-hosts
A kind Rust Discord server user on #beginners