Improve your security and privacy by blocking ads, tracking and malware domains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Héctor Molinero Fernández 001cdb2b42 3.2.2 3 weeks ago
.github Test multiple awk implementations 3 months ago
resources 3.2.2 3 weeks ago
.gitattributes Converted LF to CRLF in test file 3 months ago
.gitignore Improved package creation 7 months ago
.gitlab-ci.yml Corrected Docker image 3 months ago
BSDmakefile Prefer "command -v" over "which" 7 months ago
LICENSE.md Updated license year 5 months ago
Makefile Create temporary files instead of a single temporary directory 3 months ago
PACKAGES.md Added Homebrew package 5 months ago
README.md 3.2.2 3 weeks ago
SOURCES.md Added Dandelion Sprout's Nordic list 1 month ago
hblock 3.2.2 3 weeks ago
hblock.1 3.2.2 3 weeks ago
hblock.1.md 3.2.2 3 weeks ago
hblock.sha256 3.2.2 3 weeks ago

README.md

Improve your security and privacy by blocking ads, tracking and malware domains.

What is this for?

hBlock is a POSIX-compliant shell script that gets a list of domains that serve ads, tracking scripts and malware from multiple sources and creates a hosts file, among other formats, that prevents your system from connecting to them.

Installation

hBlock is available in various package managers. Please check the PACKAGES.md file for an up-to-date list.

The latest available version can also be installed manually by running the following commands:

curl -o /tmp/hblock 'https://raw.githubusercontent.com/hectorm/hblock/v3.2.2/hblock' \
  && echo '72eac6d67001c7b31541cf3121c15e833fc99355970e4a117be46005d8465f63  /tmp/hblock' | shasum -c \
  && sudo mv /tmp/hblock /usr/local/bin/hblock \
  && sudo chown 0:0 /usr/local/bin/hblock \
  && sudo chmod 755 /usr/local/bin/hblock

Additionally, a systemd timer can be set to regularly update the hosts file for new additions.

Usage

The default behavior of hBlock can be adjusted with multiple options. Use the --help option or check the hblock.1.md file for the full list.

asciicast

Nightly builds

Nightly builds of the hosts file, among other formats, can be found on the hBlock website.

Temporarily disable hBlock

Sometimes you may need to temporarily disable hBlock, a quick option is to generate a hosts file without any blocked domains by running the following command:

hblock -S none -D none

I found a false positive, what should I do?

It's possible that sometimes one of the hBlock sources includes a domain that shouldn't be blocked, in those cases the best way to proceed is to temporarily add said domain to the allowlist and report the problem to the original blocklist author. This way it will also be automatically removed from hBlock within 24h.

To find which blocklist is behind a false positive you can clone the hMirror project and search for that domain. Although please note that not all hMirror blocklists are used by default in hBlock, an updated list of the sources used can be found in the SOURCES.md file.