DEV Community

Cover image for 🚫 SiteBlocker – A Simple Website Blocker for Windows (Python + GUI + .exe)
Mahmudur Rahman
Mahmudur Rahman

Posted on

🚫 SiteBlocker – A Simple Website Blocker for Windows (Python + GUI + .exe)

Tired of distractions while working? Want to prevent access to specific websites from your Windows machine?

I built a small utility app called SiteBlocker that lets you easily block or unblock websites using a graphical interface β€” and yes, it's packaged as a standalone .exe` for Windows!

SiteBlocker Screenshot


🧠 What It Does

SiteBlocker.exe modifies your system’s hosts file to redirect unwanted domains to 127.0.0.1. That means blocked websites won't load in any browser on your computer.

No command line, no config files β€” click to block or unblock.


πŸ”§ Features

  • βœ… Block websites by entering the domain (e.g., facebook.com)
  • βœ… View all currently blocked websites
  • βœ… Unblock any selected website from the list
  • βœ… Clean, simple GUI (built with Tkinter)
  • βœ… Built as a single .exe using PyInstaller

Download

  1. Download executable file: https://github.com/mahmud-r-farhan/site-blocker/releases/download/v1.0.1/SiteBlocker.exe

  2. Github

    GitHub logo mahmud-r-farhan / site-blocker

    A simple desktop tool to block or unblock websites on a Windows machine using a graphical interface.

    πŸ›‘οΈ Website Blocker (Windows)

    A simple desktop tool to block or unblock websites on a Windows machine using a graphical interface. It works by modifying the hosts file to redirect unwanted domains to 127.0.0.1.

    Built with Python + Tkinter, packaged into a .exe with PyInstaller.


    Features

    • βœ… Block any website (e.g., adult website, youtube.com)
    • βœ… View currently blocked websites
    • βœ… Unblock websites easily
    • βœ… Simple GUI, no terminal needed
    • βœ… Single .exe file with icon

    How It Works

    This app modifies the Windows hosts file:

    
    C:\Windows\System32\drivers\etc\hosts
    
    

    It maps domains to 127.0.0.1, effectively blocking them:

    
    127.0.0.1 facebook.com
    
    

    Installation

    1. Right-click the .exe and choose "Run as Administrator".
    2. Use the buttons to:
      • Block new websites
      • Unblock selected websites
      • View the current list

    πŸ›  Build It Yourself (For Developers)

    Make sure Python 3.x is installed and added to PATH.

    1. Install dependencies:

    pip install pyinstaller
    
    Enter fullscreen mode Exit fullscreen mode

    2. Prepare the

    …

Follow for more

Top comments (0)