hblock
Shell script that blocks ad, tracking and malware domains via the hosts file
hblock is a command-line script that builds a hosts file blocking known advertising, tracking and malware domains. It is aimed at people who want network-wide filtering on their own machine or router without running a separate DNS server.
The script downloads public domain blocklists and writes them into the system hosts file, and it can also produce dnsmasq-compatible output. It is released under the MIT license and the source code is public on GitHub. The project has a website with documentation.
Alternatives to hblock
Products that do a similar job in Security & Privacy.
hosts
Consolidated hosts file that blocks ads, malware and unwanted sites
BlockAds
System-wide ad and tracker blocker for Android without root
Blokada
open-source ad and tracker blocker for Android and iOS
Portmaster
Application firewall for controlling outbound network traffic
Surfshark
VPN client for Linux that encrypts traffic and blocks ads
zen-desktop
System-wide ad blocker and privacy guard for desktop operating systems
Tailscale
Mesh VPN that connects your devices over WireGuard
SearXNG
Self-hostable metasearch engine that does not track or profile users