An interactive TUI application to manage domain blocking through the system's hosts file. This application provides an easy way to block and unblock domains system-wide using a terminal user interface.
Features
Interactive terminal user interface
Real-time domain blocking
Automatic DNS cache flushing
Cross-platform support (Windows, macOS, Linux)
Automatic cleanup on exit
Prerequisites
Go 1.19 or higher
Root/Administrator privileges (required for modifying hosts file and flushing DNS)
Installation
go install github.com/4ster-light/phocus@latest
Usage
Run the application with administrator privileges:
On Unix-like systems:
sudo domain-blocker
On Windows (run Command Prompt as Administrator):
domain-blocker
Enter domains to block in the input field
Press Enter to block each domain
Press ESC to quit (all blocked domains will be automatically unblocked)
How it Works
The application works by:
Modifying your system's hosts file (/etc/hosts on Unix-like systems, C:\Windows\System32\drivers\etc\hosts on Windows)
Adding entries that redirect specified domains to 127.0.0.1
Automatically flushing your system's DNS cache after each modification
Cleaning up all modifications when you exit the application