# Install hblock with Homebrew, Nix, pacman

Adblocker that creates a hosts file from multiple sources. Version 3.5.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:hblock
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install hblock
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#hblock
```

  Evidence: nixpkgs package indexes: pkgs/by-name/hb/hblock/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S hblock
```

  Evidence: Arch Linux sync databases: hblock from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## Package facts

- **Package key:** brew:hblock
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/hblock>
- **Version:** 3.5.1
- **Source summary:** Adblocker that creates a hosts file from multiple sources
- **Homepage:** <https://hblock.molinero.dev/>
- **Repository:** <https://github.com/hectorm/hblock>
- **Upstream docs:** <https://github.com/hectorm/hblock#readme>
- **License:** MIT
- **Source archive:** <https://github.com/hectorm/hblock/archive/refs/tags/v3.5.1.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- hblock (cli)
- hblock (alias)

## Uses from macOS

- curl

## Install behavior

- Post-install hook: not defined
- Bottle: available on all

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 3.5.1
- Local data: ok
- Upstream repository: https://github.com/hectorm/hblock
- Upstream latest detected: v3.5.1 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

hBlock is a POSIX shell hosts-file generator for blocking advertising, tracking, and malware domains. It belongs to the long Unix tradition of small text-processing security tools: fetch lists, merge/filter them, and write a system file or alternate output format.

### Project history

The public GitHub repository was created in August 2015 by Hector Molinero Fernandez. The README describes hBlock as a POSIX-compliant shell script that gathers domains from multiple sources and creates a hosts file, among other formats, to prevent systems from connecting to them.

The manpage documents the program as hBlock 3.5.1 and exposes its design through options: output file, header, footer, sources file, allowlist, denylist, redirection address, wrapping, template, comments, lenient matching, regex allowlists, subdomain filtering, retries, continuation on download error, and parallel downloads.

### Adoption history

The README points users to a package list and mentions various package managers. Input facts show hBlock packaged in Homebrew, Nix, and pacman, which fits its audience: Unix-like users who want repeatable hosts-file generation rather than a browser-specific blocker.

The project also publishes nightly generated blocklist outputs on its website and documents a systemd timer for regular updates, showing use as both a local command and scheduled system maintenance tool.

### How it is used

The default workflow is to run hblock and let it generate a hosts file from built-in or configured sources. Users can point it at custom sources.list, allow.list, deny.list, header, and footer files under XDG_CONFIG_HOME/hblock or /etc/hblock, or print to stdout for integration with other tooling.

The README warns that hBlock replaces the system hosts file by default, so careful use and backups matter when a machine already has local hosts entries.

### Why package nerds care

hBlock is package-nerd friendly because it is just a shell script with explicit files, environment variables, and predictable Unix paths. It demonstrates how a tiny package can wrap a volatile external data problem while leaving policy in plain text files.

### Timeline

- 2015: Public GitHub repository created.
- 2020s: hBlock documents versioned manual pages and a 3.x command surface.
- 2020s: Homebrew, Nix, and pacman package names appear in input package facts.

### Related projects

- hMirror is related by upstream maintainer documentation as a way to inspect source blocklists behind false positives.
- Hosts-file blocklists, dnsmasq-style outputs, and systemd timers are related operational pieces described by the README and manpage.

### Sources

- <https://api.github.com/repos/hectorm/hblock>
- <https://github.com/hectorm/hblock>
- <https://raw.githubusercontent.com/hectorm/hblock/master/README.md>
- <https://raw.githubusercontent.com/hectorm/hblock/master/hblock.1.md>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: $XDG_CONFIG_HOME/hblock/sources.list, /etc/hblock/sources.list, $XDG_CONFIG_HOME/hblock/allow.list, /etc/hblock/allow.list, $XDG_CONFIG_HOME/hblock/deny.list, /etc/hblock/deny.list, $XDG_CONFIG_HOME/hblock/header, /etc/hblock/header, $XDG_CONFIG_HOME/hblock/footer, /etc/hblock/footer
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** hblock
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Nix - hblock: normalized package name match | nixpkgs package indexes: pkgs/by-name/hb/hblock/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - hblock - 3.5.1-1: normalized package name match | Arch Linux sync databases: hblock from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Adblocker that creates a hosts file from multiple sources | https://hblock.molinero.dev/


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Security and crypto packages](https://www.automicvault.com/pkg/security-crypto-tools/) - Matched security, identity, cryptography, password, signing, or certificate metadata.
- [Homebrew utility packages](https://www.automicvault.com/pkg/brew-utility-packages/) - Matched Homebrew package provider.
- [libotr](https://www.automicvault.com/pkg/brew/libotr/) - Shares av.db curated category or tags: cli, privacy, security.
- [mat2](https://www.automicvault.com/pkg/brew/mat2/) - Shares av.db curated category or tags: cli, privacy, security.
- [acme.sh](https://www.automicvault.com/pkg/brew/acme-sh/) - Shares av.db curated category or tags: cli, security, shell.
- [chaos-client](https://www.automicvault.com/pkg/brew/chaos-client/) - Shares av.db curated category or tags: cli, dns, security.
- [cryfs](https://www.automicvault.com/pkg/brew/cryfs/) - Shares av.db curated category or tags: cli, privacy, security.
- [dnsgen](https://www.automicvault.com/pkg/brew/dnsgen/) - Shares av.db curated category or tags: cli, dns, security.
- [dnsmap](https://www.automicvault.com/pkg/brew/dnsmap/) - Shares av.db curated category or tags: cli, dns, security.
- [dnstwist](https://www.automicvault.com/pkg/brew/dnstwist/) - Shares av.db curated category or tags: cli, dns, security.

## Combined YAML source

View the package source record on GitHub. [combined/hblock.yml](https://github.com/automic-vault/db/blob/main/combined/hblock.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
