While ad-blocking software and hardware solutions like Raspberry Pi running Pi-Hole are common tools for managing online advertisements, they can sometimes face reliability issues. An innovative alternative has emerged, demonstrating that effective network filtering doesn't require complex or expensive hardware. Egyptian developer ZedAxis has introduced a compact solution that challenges traditional approaches to domain filtering.

A Compact and Inexpensive Build

At the heart of this project is the ESP32-C3 "SuperMini" board, a device priced at approximately $5. The developer has successfully configured this small piece of hardware to function as a DNS sinkhole, capable of managing an extensive list of blacklisted domains within its 4MB flash storage. The project is highly accessible, with the developer having shared the necessary code on GitHub, making it a viable option for those looking for a lightweight, DIY alternative to standard network ad blockers.

To make the device functional, the board is paired with a USB adapter and housed in a 3D-printed enclosure. It can be conveniently powered via a USB port on a router, smart TV, gaming console, or any other device that remains powered on. The system is user-friendly, featuring a web-based dashboard, support for mDNS for easy device discovery, and the capability to receive over-the-air (OTA) updates.

Innovative Compression Techniques

A significant technical challenge of this project was fitting such a large database of blocked domains into limited storage. The developer explains:

«Strictly speaking, 4MB should not be able to hold 500,000 domains... So how are the 537,000 domains squeezed into 4MB of RAM?»

To overcome memory constraints, the project utilizes the 40-bit FNV-1a hashing algorithm. This method allows for high-speed domain matching with minimal collisions. By optimizing how the blacklist is stored, the developer managed to compress a vast number of domains into a fraction of the available flash memory. For instance, roughly 141,000 domains occupy only about 0.7MB of flash, requiring less than 50 KB of RAM for active matching.

Future Potential and Practical Use

While the current configuration typically limits blacklists to around 250,000 domains to reserve space for firmware updates, the system remains highly capable. The developer plans to expand the project's functionality, including potential support for DHCP server capabilities. This low-cost, low-power approach raises an interesting possibility: could such simple devices become a standard tool for small businesses looking to reduce bandwidth consumption caused by pervasive ad networks?