• Stars
    star
    1,366
  • Rank 33,130 (Top 0.7 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 8 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

⚠️ 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 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.4.4/hblock' \
  && echo '7ad94c8525e6076c56b9209ed73d132b8b9600a2e5e9738b3cdc02839d6d4215  /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.

More Repositories

1

docker-qemu-win2000

A Docker image for Windows 2000 Advanced Server with SP4.
Makefile
861
star
2

otpauth

One Time Password (HOTP/TOTP) library for Node.js, Deno, Bun and browsers.
JavaScript
578
star
3

elementary-dropbox

Installs Dropbox and integrates it with WingPanel (for Elementary OS).
Shell
448
star
4

hmirror

Mirror of multiple third-party blocklists (updated daily).
Shell
139
star
5

docker-qemu-reactos

A Docker image for the ReactOS operating system.
M4
59
star
6

wireguard-setup

WireGuard and Unbound setup with Packer and Terraform.
HCL
56
star
7

docker-xubuntu

A Docker image with the Xfce desktop environment, VirtualGL, XRDP and XRDP PulseAudio module.
M4
53
star
8

docker-pwnagotchi

Pwnagotchi on Docker.
Shell
30
star
9

hblock-resolver

A Docker image of Knot DNS Resolver with hBlock.
M4
22
star
10

docker-qemu-haiku

A Docker image for the Haiku operating system.
Shell
19
star
11

demergi

A proxy server that helps to bypass the DPI systems implemented by various ISPs.
JavaScript
19
star
12

docker-goaccess

A Docker image for GoAccess.
Makefile
19
star
13

cetusguard

CetusGuard is a tool that protects the Docker daemon socket by filtering calls to its API endpoints.
Go
17
star
14

pzntg

Indexed color PNG image generator.
JavaScript
12
star
15

fast-cli

Test your latency, download speed and upload speed using fast.com.
Shell
12
star
16

docker-caddy

A Docker image for Caddy.
Makefile
11
star
17

docker-musikcube

A Docker image for musikcube.
Makefile
9
star
18

docker-wine

A Docker image for Wine based on Xubuntu on Docker.
Makefile
8
star
19

docker-winamp

A Docker image for the legendary Winamp 2.95 media player.
Shell
8
star
20

docker-volume-helpers

Backup, restore and explore Docker volumes.
Makefile
6
star
21

docker-compose-helpers

Shell
6
star
22

docker-qemu-user-static

A Docker image with the QEMU user mode emulation static binaries.
Makefile
5
star
23

alexa-top-1m

JavaScript
5
star
24

music-dl

Shell
5
star
25

cloudflare-ddns

Cloudflare Dynamic DNS.
Makefile
5
star
26

docker-pinball

Shell
4
star
27

docker-sftp

A Docker image with an OpenSSH server configured for SFTP and rsync.
Makefile
4
star
28

docker-dropbear

A Docker image with a Dropbear SSH server compatible with SFTP, SCP and rsync.
Makefile
4
star
29

docker-steam

A Docker image for Steam based on Xubuntu on Docker.
Makefile
4
star
30

docker-supercronic

A Docker image for Supercronic.
Makefile
3
star
31

docker-dnsperf

A Docker image for dnsperf, resperf and flamethrower.
Makefile
3
star
32

docker-oilshell

A Docker image for Oil shell.
Makefile
3
star
33

rock960-c-build

ROCK960 Model C build scripts
Shell
3
star
34

docker-wasm

A Docker image with the latest version of Emscripten and basic development tools.
Dockerfile
3
star
35

hectorm.github.io

Vue
2
star
36

logo

Shell
2
star
37

docker-curl

A statically linked build of cURL in a Docker container.
Makefile
2
star
38

docker-volumex

Extra functionalities to manage volumes.
Shell
2
star
39

hectorm

2
star
40

docker-watchtower

A Docker image for Watchtower.
Makefile
2
star
41

docker-udptunnel

A statically linked build of udptunnel in a Docker container.
Makefile
2
star
42

liquid-rescale

Shell
2
star
43

docker-389ds

A Docker image for 389 Directory Server.
Shell
2
star
44

NotoColorEmoji-Extractor

Shell
1
star
45

.github

GitHub config
1
star
46

docker-scratch

Empty Docker images with different architectures defined in its manifest.
Dockerfile
1
star
47

docker-bulk

Perform bulk actions on Docker resources.
Shell
1
star
48

docker-imapsync

A Docker image for Imapsync.
Makefile
1
star
49

docker-lego

A Docker image for lego.
Makefile
1
star