A lightweight, universal site blocker for Linux. It blocks access to specified websites across all browsers and applications by redirecting traffic at the system level (/etc/hosts) and serving a custom "Access Denied" page.
- Universal Blocking: Works with Firefox, Chrome, Opera, curl, wget, etc.
- Lightweight: Written in Bash. No heavy dependencies.
- Customizable: Easy to add/remove sites via a simple text file.
- System Integration: Runs as a systemd service for automatic startup.
- Clone the repository (or download the files).
- Run the installer with root privileges:
sudo ./install.shThe installer will:
- Install
netcatif missing. - Create a configuration file at
~/.blockedsites. - Install the service and start it.
- Open
~/.blockedsitesin your favorite text editor. - Add the domain names you want to block (one per line).
example.com facebook.com tiktok.com - Restart the service to apply changes:
sudo systemctl restart universal-blocker
- Remove the domain from
~/.blockedsites. - Restart the service:
sudo systemctl restart universal-blocker
To remove the blocker and restore your system:
sudo ./uninstall.sh- DNS Override: The service adds entries to
/etc/hostspointing blocked domains to127.0.0.1(localhost). - Local Redirection: When you try to visit a blocked site, your computer connects to
localhost.- If you have a local web server running (e.g., for development), you will see your local site.
- If nothing is running on port 80, you will see a "Connection Refused" error.
- In either case, the blocked site is inaccessible.