#host #malware #unbound #generate #adware

app tenshi

Unbound local-zone generator for curated hosts files

8 releases

0.2.2 Jun 11, 2019
0.2.1 May 20, 2019
0.1.4 May 20, 2019

#4 in #unbound

GPL-3.0-or-later

16KB
86 lines

Tenshi

crates.io aur

Tenshi is a fast CLI utility that fetches a curated hosts file, generates Unbound local-zone entries from it, and saves them to /etc/unbound/local-blocking-data.conf.

At the moment, only Steven Black's hosts file is used.

Tenshi is primarily written to work on Linux, but it will likely work on the BSDs. It is untested on Macintosh, 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.

Installation

Prerequisites

Install either rustup or rust using your favorite package manager. Tenshi is known to build against Rust 1.35.

Tenshi must be run as a user that has write access to /etc/unbound/local-blocking-data.conf.

Build with Cargo

cargo install tenshi

Build from source

git clone https://github.com/flacks/tenshi.git
cd tenshi
git checkout $(git tag | tail -n 1)
cargo build --release
cargo install --path .

Arch Linux

git clone https://aur.archlinux.org/tenshi-rs.git
cd tenshi-rs
makepkg -i

Synopsis

If installed with Cargo or built from source, ensure Cargo's bin directory is in your PATH.

Run tenshi and follow prompt. For promptless execution, prepend true | to command.

To do

  • Actually support different hosts files
    • Upstream variants
  • Custom hosts files support
  • Argument support
  • Quiet mode
  • Support changing data destination
  • Modularize code
  • Detect if hosts file remains the same
  • Notify user of hosts file update, requiring Unbound reload

Credits

Inspired by https://github.com/gbxyz/unbound-block-hosts

A kind Rust Discord server user in #beginners

Dependencies

~23MB
~487K SLoC