Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Universal Ad/Site Blocker

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.

Features

  • 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.

Installation

  1. Clone the repository (or download the files).
  2. Run the installer with root privileges:
sudo ./install.sh

The installer will:

  • Install netcat if missing.
  • Create a configuration file at ~/.blockedsites.
  • Install the service and start it.

Usage

Adding Sites to Block

  1. Open ~/.blockedsites in your favorite text editor.
  2. Add the domain names you want to block (one per line).
    example.com
    facebook.com
    tiktok.com
    
  3. Restart the service to apply changes:
    sudo systemctl restart universal-blocker

Unblocking Sites

  1. Remove the domain from ~/.blockedsites.
  2. Restart the service:
    sudo systemctl restart universal-blocker

Uninstallation

To remove the blocker and restore your system:

sudo ./uninstall.sh

How It Works

How It Works

  1. DNS Override: The service adds entries to /etc/hosts pointing blocked domains to 127.0.0.1 (localhost).
  2. 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages