Improve your security and privacy by blocking ads, tracking and malware domains. https://hblock.molinero.dev
  • Shell 87.4%
  • Makefile 5.5%
  • Roff 4.4%
  • M4 2.7%
Find a file
Héctor Molinero Fernández aa1dea95ba Update Systemd units
2017-11-23 22:32:22 +01:00
resources Update Systemd units 2017-11-23 22:32:22 +01:00
.gitignore Added package.json 2017-11-20 21:39:08 +01:00
.gitlab-ci.yml Added package.json 2017-11-20 21:39:08 +01:00
firebase.json Firebase migration 2017-07-31 23:31:19 +02:00
hblock Added "--version" parameter 2017-11-19 02:12:51 +01:00
LICENSE.md Change license year 2017-01-14 13:09:06 +01:00
Makefile Run targets only when necessary 2016-12-08 20:26:48 +01:00
package.json Added package.json 2017-11-20 21:39:08 +01:00
README.md Updated checksum 2017-11-19 02:16:06 +01:00

Build Website License


hBlock

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

Table of contents

What is this for?

This POSIX-compliant shell script, designed for Unix-like systems, gets a list of domains that serve ads, tracking scripts and malware from multiple reputable sources and creates a hosts file that prevents your system from connecting to them.

Is it safe to use?

Absolutely, this script selects only the domain names for each source, so if a domain name is redirected to a rogue server your system will not be affected. In the worst scenario you can lose access to a legitimate domain name due a false positive, but you can reverse it by adding that domain to the whitelist.

Nightly builds

I provide nightly builds of the hosts file and installers for Windows (batch file installer) and Android (flashable zip).

URL
https://hblock.molinero.xyz

Usage

Run without installation

curl 'https://raw.githubusercontent.com/zant95/hblock/master/hblock' -o /tmp/hblock && \
  echo '42a822463ea52238e4730374ac4c0f4d530724469c172c93ceca949d5e1ee9d8  /tmp/hblock' | shasum -c && \
  sh /tmp/hblock

Installation

curl 'https://raw.githubusercontent.com/zant95/hblock/master/hblock' -o /tmp/hblock && \
  echo '42a822463ea52238e4730374ac4c0f4d530724469c172c93ceca949d5e1ee9d8  /tmp/hblock' | shasum -c && \
  sudo mv /tmp/hblock /usr/local/bin/hblock && sudo chmod a+rx /usr/local/bin/hblock

Note: be sure to regularly update the hosts file for new additions or download the script and create a scheduled task.

Script arguments

You can also change the default behavior using these options:

Usage: hblock [options...]
 -O, --output FILE            Output file (default: /etc/hosts)
 -R, --redirection IP         Domain redirection IP (default: 0.0.0.0)
 -H, --header STRING          File header (default: see source code)
 -S, --sources STRING         Space separated URLs (default: see source code)
 -W, --whitelist STRING       Space separated entries, POSIX basic regex (default: see source code)
 -B, --blacklist STRING       Space separated entries (default: see source code)
 -b, --backup                 Make a time-stamped backup (default: disabled)
 -l, --lenient                Select any IP address from sources (default: 0.0.0.0, 127.0.0.1 or none)
 -i, --ignore-download-error  Do not abort on download error (default: disabled)
 -h, --help                   Print this help

Run preview

asciicast

Sources

Name Primary Mirror
adaway.org URL URL
disconnect.me - Ad URL URL
disconnect.me - Malvertising URL URL
disconnect.me - Malware URL URL
disconnect.me - Tracking URL URL
FadeMind - add.2o7Net URL URL
FadeMind - add.Dead URL URL
FadeMind - add.Risk URL URL
FadeMind - add.Spam URL URL
KADhosts URL URL
malwaredomainlist.com URL URL
malwaredomains.com - Immortal domains URL URL
malwaredomains.com - Just domains URL URL
pgl.yoyo.org URL URL
ransomwaretracker.abuse.ch URL URL
someonewhocares.org URL URL
spam404.com URL URL
winhelp2002.mvps.org URL URL
zeustracker.abuse.ch URL URL

Disclaimer

This script, by default, replaces the /etc/hosts file of your system. I am not responsible for any damage or loss, always make backups.

License

See the license file.