Block-Site
is a simple and effective command-line tool that helps you block and unblock websites by modifying the /etc/hosts
file. With an easy-to-use interface, the tool allows users to manage site access directly from the terminal using Homebrew.
Source Code on GitHub:
Introduction
Managing online distractions has never been easier. Block-Site
is a bash script designed for macOS and Linux users, allowing them to block or unblock websites effortlessly. The tool modifies the /etc/hosts
file to redirect domains to 127.0.0.1
, effectively preventing access to the websites. It’s perfect for users looking to increase productivity or restrict access to specific sites on their system.
Technologies
- Bash Scripting: The core of the project is a simple bash script that automates the process of editing the
/etc/hosts
file. - Homebrew: The script is packaged and distributed via Homebrew for easy installation and use.
Features
- Block Websites: Instantly block any website by running
block-site --block domain.com
. - Unblock Websites: Easily restore access by running
block-site --unblock domain.com
. - Automated DNS Flush: The script automatically flushes the DNS cache, ensuring changes take effect immediately.
More
Block-Site
is lightweight and straightforward, making it a useful tool for anyone looking to manage website access efficiently without complicated setups.
Links
- Source Code: https://github.com/Chaitanya-Shahare/block-site