HBLOCK(1)
β¨ hBlock, but make it make sense β¨
okay so bestie, sit down, because this is the hBlock man page (it lives in section 1 of the manual, the User Commands girlies π
) and honestly? it's kind of iconic. i'm gonna walk you through it like we're on facetime and i'm explaining it with my whole chest π«Ά
πΈ SYNOPSIS πΈ
hblock [OPTION]...
likeβ¦ that's it. you just run hblock and throw options at it. no cap, that's the whole vibe π
π DESCRIPTION π
so hBlock is a POSIX-compliant shell script β yes, a shell script, she's lowkey humble but she WORKS β and what she does is: she goes and gets a list of domains that serve ads, tracking scripts and malware from multiple sources, and then she creates a hosts file (among other formats, she's versatile like that) that prevents your system from connecting to them. periodt. no ads, no trackers, no malware, literally none π₯
it's giving protective older sister energy fr fr π§
β¨ OPTIONS β¨
okay this is the long part, but every single one matters, so stay with me bestie. i'm not skipping a single one, that would be a crime π
π the output & content options
-O,--output <FILE|->,${HBLOCK_OUTPUT_FILE}β where the output file goes. if it equals-, it's printed to stdout instead (surprise! it's a stream now π ). (default:/etc/hosts)-H,--header <FILE|builtin|none|->,${HBLOCK_HEADER_FILE}β the file that gets included at the beginning of the output file. if it equalsbuiltin, the built-in value is used. if it equalsnone, an empty value is used. if it equals-, the stdin content is used. and if you leave it unspecified and any of the following files exists, its content is used:${XDG_CONFIG_HOME}/hblock/header/etc/hblock/header
(default: builtin)
-F,--footer <FILE|builtin|none|->,${HBLOCK_FOOTER_FILE}β same deal but it goes at the end of the output file π¦. if it equalsbuiltin, the built-in value is used. if it equalsnone, an empty value is used. if it equals-, the stdin content is used. and if unspecified, and any of these exist, its content is used:${XDG_CONFIG_HOME}/hblock/footer/etc/hblock/footer
(default: builtin)
-S,--sources <FILE|builtin|none|->,${HBLOCK_SOURCES_FILE}β a file with line separated URLs that are used to generate the blocklist. if it equalsbuiltin, the built-in value is used. if it equalsnone, an empty value is used. if it equals-, the stdin content is used. if unspecified, and any of these exist, its content is used:${XDG_CONFIG_HOME}/hblock/sources.list/etc/hblock/sources.list
(default: builtin)
-A,--allowlist <FILE|builtin|none|->,${HBLOCK_ALLOWLIST_FILE}β a file with line separated entries to be removed from the blocklist (the "bestie i prommy this one is fine, let her through" list π). if it equalsbuiltin, the built-in value is used. if it equalsnone, an empty value is used. if it equals-, the stdin content is used. if unspecified, and any of these exist, its content is used:${XDG_CONFIG_HOME}/hblock/allow.list/etc/hblock/allow.list
(default: builtin)
-D,--denylist <FILE|builtin|none|->,${HBLOCK_DENYLIST_FILE}β a file with line separated entries to be added to the blocklist (the "nope, absolutely not, blocked" list π«). if it equalsbuiltin, the built-in value is used. if it equalsnone, an empty value is used. if it equals-, the stdin content is used. if unspecified, and any of these exist, its content is used:${XDG_CONFIG_HOME}/hblock/deny.list/etc/hblock/deny.list
(default: builtin)
π¦ the formatting options
-R,--redirection <REDIRECTION>,${HBLOCK_REDIRECTION}β the redirection used for all entries in the blocklist. (default:0.0.0.0)-W,--wrap <NUMBER>,${HBLOCK_WRAP}β breaks blocklist lines after this number of entries, so your file doesn't turn into one unreadable mega-line π (default:1)-T,--template <TEMPLATE>,${HBLOCK_TEMPLATE}β the template applied to each entry. the placeholders are literally these:%D=<DOMAIN>%R=<REDIRECTION>
(default: %R %D)
-C,--comment <COMMENT>,${HBLOCK_COMMENT}β the character used for comments. (default:#)
π§ the behaviour options
-l,--[no-]lenient,${HBLOCK_LENIENT}β match all entries from sources regardless of their IP, instead of only0.0.0.0,127.0.0.1,::,::1or nothing. (default:false)-r,--[no-]regex,${HBLOCK_REGEX}β use POSIX BREs in the allowlist instead of fixed strings. regex girlies rise π«Ά (default:false)-f,--[no-]filter-subdomains,${HBLOCK_FILTER_SUBDOMAINS}β do not include subdomains when the parent domain is also blocked. super useful for reducing the blocklist size in cases such as when DNS blocking makes these subdomains redundant β¨ (default:false)-n,--retry <NUMBER>,${HBLOCK_RETRY}β number of times to retry a failed download. bestie said "try again" and meant it π (default:0)-c,--[no-]continue,${HBLOCK_CONTINUE}β do not abort if a download error occurs. she pushes through π€ (default:false)-p,--parallel,${HBLOCK_PARALLEL}β maximum concurrency for parallel downloads. (default:4)-q,--[no-]quiet,${HBLOCK_QUIET}β suppress non-error messages. we love a low-key queen π€« (default:false)-x,--color <auto|true|false>,${HBLOCK_COLOR}β colorize the output. (default:auto)-v,--versionβ show version number and quit. bye π-h,--helpβ show this help and quit. hi π
π REPORTING BUGS π
found a bug? don't be shy, tell on it:
- Report bugs to: <https://github.com/hectorm/hblock/issues>
some credits, because we respect the devs around here π:
- Author: HΓ©ctor Molinero FernΓ‘ndez
<hector@molinero.dev> - License: MIT, <https://opensource.org/licenses/MIT>
- Repository: <https://github.com/hectorm/hblock>
ngl if something is acting up, the issues page is the move β that's the whole point of it, bestie π«Ά
okay that's the page!! mwah π this is hBlock version 3.5.1, dated March 2025, written by that legend HΓ©ctor Molinero FernΓ‘ndez β go block some ads, you absolute icon πβ
π¦ where this page comes from
- arch rolling: hblock 3.5.1-1 Β· MIT
- nixos 26.05: hblock 3.5.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms