Grad shape
Grad shape

Maza ad blocking

DNS

About this project

🥇 Top 1 in Hacker News

Comments: https://news.ycombinator.com/item?id=22717650

banner

A command to squash all ads in all browsers

sudo maza start

Like Pi-hole but local and using your operating system.

Simple, native and efficient local ad blocker. Bash script compatible with MacOS, Linux, BSD and Windows Subsystem for Linux (WSL).

  • Just bash 🤖.
  • It affects any browser or software installed 😱.
  • You don't have to install any browser extensions or applications 🚫, you just use the tools of your operating system.
  • You update the list of DNS to be blocked with a single command 😎.
  • Pure Opensource ❤️.
demo

Index

📟 Commands

📡 Update database

sudo maza update

🔨 Start

sudo maza start

🛠 Stop

sudo maza stop

⚖️ Status

sudo maza status

⚙️ Install or Update

😥 Requirements

  • bash 4.0 or higher
  • curl
  • Only macOS users, gsed: brew install gnu-sed

Then you do this.

curl -o maza https://raw.githubusercontent.com/tanrax/maza-ad-blocking/master/maza && sudo rm -rf /usr/local/bin/maza && chmod +x maza && sudo mv maza /usr/local/bin

Optional but recommended, make a backup of your hosts file.

sudo cp /etc/hosts /etc/hosts.backup

🧪 Check if you block ads

You can run a test to see if the domains are blocked.

For example, you can run the following command.

curl googleadservices.com

If you get an error like this, it means that the domain is blocked.

curl: (7) Failed to connect to googleadservices.com port 80 after 2 ms: Could not connect to server

But if you get a response with HTML, it means that the domain is not blocked (maybe a 404 error).

🤖 Auto update of domains to be blocked

Open your cron.

crontab -e

Add the following line at the end.

@daily maza update

Some users have reported problems creating daemons on MacOS. Fixed with TERM=dumb.

TERM=dumb
@daily maza update

🔪 Uninstall

sudo rm /usr/local/bin/maza && sudo rm -r /root/.config/maza

🚫 Not blocking

Technologies & License
Apache-2.0 Shell
Quick Deploy

Deploy this project to cloud platforms with one click