2 pointsby Reazonaya day ago1 comment
  • Reazonaya day ago
    I wanted to understand how network-wide ad blocking works under the hood, so I decided to build my own DNS sinkhole from scratch using Python instead of just installing Pi-hole.

    It's called GhostShield.

    The Stack:

    Hardware: Optimized for Raspberry Pi Zero W.

    Backend: Python 3 using dnslib for handling DNS requests and Flask for the web server.

    Performance: It uses an in-memory SQLite database to minimize SD card write cycles (a common issue with Raspi logs).

    Frontend: A custom "Cyberpunk"-styled dashboard to visualize live traffic and blocked domains in real-time.

    It pulls blocklists from the StevenBlack hosts list (approx 150k domains).

    This is a passion project to learn more about DNS protocols and socket programming. I know it's not as feature-rich as Pi-hole or AdGuard Home yet, but I'd love to hear your feedback on the code and architecture!

    Repo is here: https://github.com/Reazonay/GhostShield