__ __ __
/ /_ _____ / /_ / /
/ __ \ / ___/ / __/ / /
/ / / // /__ / /_ / /
/_/ /_/ \___/ \__/ /_/
Hostlists tools cli hctl
is app written in rust to manage (merge, transform, clear from comments etc.) your hostlists from diffrent formats to selected by you!
openssl
brew install openssl@3
choco
or vcpkg
or whatever other way that won't welcome viruses.Note that you can get rid of openssl dependency if you want, by building from source with modified dependencies, see building from source.
Available:
apk add hctl --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing/
(from testing repository)opi hctl
(using opi community repo helper)yay -Su hctl
(using AUR helper)Packaging progress issue
❗ BUILD REGRESSION |
---|
OpenBSD and DragonflyBSD doesn't have rust tier 1 support and their repo version is too old to compile on stable
OS |
---|
Linux glibc |
Linux musl |
MacOS X |
Windows |
FreeBSD |
NetBSD |
Illumos |
amd64 | aarch64 |
---|---|
app, sha256 | app, sha256 |
app, sha256 | app, sha256 |
app, sha256 | app, sha256 |
app, sha256 | app, sha256 |
app, sha256 | NSU |
app, sha256 | NSU |
app, sha256 | NSU |
amd64 | aarch64 |
---|---|
NSU | |
NSU | |
NSU |
\n\r
)Jump here to see supported input and output formats
Jump here to feature-request issue.
# hctl -D --help
Manipulate on domains
Usage: hctl {domain|--domain|-D} [OPTIONS]
Options:
-p, --path <path> Path to file to be read [path without quotes]
-o, --out <out> Path to the out file [stdout/path without quotes]
-z, --optimize <optimize> Optimize for memory or speed, default: memory [memory/speed]
-c, --config <config> Path to config [without qoutes]
-m, --mode <mode> Process single or multiple lists [single/folder/config/url]
-i, --intro <intro> Whether append intro "Assembled From:..." to out file from config [true/false]
-r, --rejected <rejected> Whether save rejected to ./rejected.txt [true/false]
-f, --format <format> Type of out format [dnsmasq/loopback/empty/linewise/bind/snort/unbound/machosts/hostperm1/junkbuster/littlesnitch/pdnsd]
-t, --validate <validate> (Non-intrusive): Verbose validate your records in single file issuing dns-over-tls query in hardcoded servers [yes/no]
-d, --dns <dns> Validate your processed records issuing dns query in predefined servers, config mode allows custom ones [yes/no]
-a, --pattern <pattern> Input format of list [hosts/dnsmasq]
-h, --help Print help
There is heavy usage of rust iterators to enable lazy-reading
Processing is done by firstly removing addreses characteristic for host file like 127.0.0.1 and comments after the records. Next tool removes all whitespace characters and non-urls using regex. See rules.rs if you want to embed similar solution in your app.