Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hectorm/hblock

Improve your security and privacy by blocking ads, tracking and malware domains.
https://github.com/hectorm/hblock

ad-blocker adblock adblocker ads advertisements blocker dns dnsmasq hosts hostsfile malware privacy protection ransomware security shell trackers tracking trojans unified-hosts

Last synced: 29 days ago
JSON representation

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

Awesome Lists containing this project

README

        






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](./SOURCES.md)
and creates a [hosts file](https://en.wikipedia.org/wiki/Hosts_(file)), [among other formats](./resources/alt-formats/), that prevents your system
from connecting to them.

:warning: hBlock by default **replaces the hosts file of your system**, consider making a backup first if you have entries you want to preserve.

## Installation

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

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

```sh
curl -o /tmp/hblock 'https://raw.githubusercontent.com/hectorm/hblock/v3.4.5/hblock' \
&& echo '2db6f52a14a3b87ff86b0fde3583f1a635ff580d26b36f8a103997a614314c6f /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](resources/systemd/) 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](./hblock.1.md) file for the
full list.

[![asciicast](https://asciinema.org/a/VuQmlvjF3j6KBberJVJKcn1Oi.svg)](https://asciinema.org/a/VuQmlvjF3j6KBberJVJKcn1Oi)

## Nightly builds

Nightly builds of the hosts file, among other formats, can be found [on the hBlock website](https://hblock.molinero.dev).

## 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:

```sh
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](https://github.com/hectorm/hmirror) 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](./SOURCES.md) file.