Skip to content
Michał Szmidt edited this page Mar 4, 2024 · 5 revisions

Supported Formats

The color or thickness of emoji is non-important, this is some github rendering issue

Format input output argname
Line-by-line ✔️ ✔️ linewise
127.0.0.1 ✔️ ✔️ localhost
0.0.0.0 ✔️ ✔️ empty
dnsmasq ✔️ ✔️ dnsmasq
snort ✔️ ✔️ snort
squid ✔️ 🚫 squid
unbound 🚫 ✔️ unbound
bind ✔️ ✔️ bind
netgar ✔️ 🚫 netgar
adblock 🚫 🚫 adblock
mac hosts ✔️ ✔️ machosts
hostperm.1 ✔️ ✔️ hostperm1
junkbuster ✔️ ✔️ junkbuster
little snitch 🚫 ✔️ littlesnitch
pdnsd 🚫 ✔️ pdnsd

Usage

Options

For now, only domain subcommand is avaliable

# hctl --help
Ultimate hostlist tool

Usage: hctl <COMMAND>

Commands:
  domain, -D, --domain  Manipulate on domains
  help                  Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

domain subcommand is used to manipulate hostlists containing only domains.

# 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
  • mode selects if only one list / folder of lists / config that contains enumerated url will be processed.
  • optimize modes differs in that way, that if memory is used, then file is lazy-read linewise and processed. Speed, reads whole file into memory and parallel process records.
  • intro appends below text in the beginning:
# This hostlist was assembled
# From other lists:
#     - https://...
#     - https://...
  • rejected are lines caught by filters, they can be collected and saved.

Examples

  • hctl -D -m single -p /path/to/dirty_list.txt -o ./out.txt -z speed -i yes -r yes - will read single list optimized for speed, will append intro and save rejected and out in the running dir.
  • hctl -D -m url -p https://single.remote/list.txt -o ./out.txt - will read single list directly from web, will append intro and save rejected and out in the running dir.
  • hctl -D -m multiple -p /path/to/dirty_lists -o ./out.txt - will read folder of lists optimized for memory without saving rejected.
  • hctl -D -m config -c /path/to/config/hctl.yml -o ./out.txt - will read lists from network, listed in config of lists optimized for memory without saving rejected without intro.
  • hctl -D -m config -c https://remote.config/hctl.yml -o ./out.txt - will read lists from network, listed in remote config of lists optimized for memory without saving rejected without intro.
Clone this wiki locally