A simple program to generate hosts file from specified blocklist URLs.
- Downloads specified blocklist URLs in
/etc/genhosts/config.toml
- Concatenates each one, ordered by priority
- Removes duplicate entries
- Hosts download directory, output location
- Dumps default config to
/etc/genhosts/config.toml
if specified - Restores default
/etc/hosts
if specified - Loads config from a custom file if specified
- A C++ compiler with C++20 support
- Meson build system
- libcurl library
- Clone the repository:
git clone https://github.com/randalthor17/genhosts.git
- Navigate to the project directory:
cd genhosts
- Generate meson build directory:
meson setup -Dbuildtype=release -Db_strip=true --prefix=/usr build
Note: You can change the prefix to ~/.local
to do a local installation.
- Build the project:
meson compile -C build
- Install the project:
meson install -C build
genhosts [OPTION...]
-c, --config arg Configuration file location (default:
/etc/genhosts/config.toml)
--hosts-save-dir arg Hosts file download directory (default:
/etc/hosts.d)
-o, --output arg Hosts output path (default: /etc/hosts)
-s, --dump-config [=arg(=/etc/genhosts/config.toml)]
Dump config to a specific path
--restore [=arg(=/etc/hosts)]
Restore hosts file
-h, --help Print help
This project is licensed under the MIT License - see the LICENSE file for details.