ESP32 dongle blocks 537K domains in 4MB flash

Get the Tech newsletter
Daily tech — startups, AI labs, chips, the launches that shape the next decade. Free.
- ZedAxis (@M-Abozaid) built a DNS-based ad blocker on a $5 ESP32-C3 SuperMini board with 400KB of RAM and 4MB of flash, filling it with roughly 537,000 blocked domains fetched from public blocklists.
- The build compresses domains using 40-bit FNV-1a hashes — 32-bit produced too many collisions while 64-bit wasted space — then sorts the resulting list and writes it directly to flash for a binary search on each query.
- Finished firmware uses only around 50KB of RAM and answers blocked DNS lookups in roughly 10 milliseconds, forwarding non-blocked queries to an upstream resolver.
- The design reclaims the ESP32's second firmware partition (normally reserved for over-the-air updates), nearly doubling blocklist capacity from about 250,000 with OTA support enabled to roughly 537,000 without it.
- The device targets a specific niche as a backup DNS for a primary Pi-hole installation, with no per-client statistics, historical query logs, or advanced knobs — Tom's Hardware frames it as 'a tiny insurance policy' rather than a replacement.
- ZedAxis powers the unit solely from the USB port on the back of an ISP-provided Huawei OptiXstar fiber gateway; the port carries only 5 volts of power and no data, with all traffic flowing over the ESP32's integrated Wi-Fi adapter.
Why it matters: In an era where a Raspberry Pi costs a couple hundred dollars, this $5 device runs on a router's USB port, sips a few dozen milliamps, and keeps network-wide ad filtering alive when a Pi-hole reboots or goes offline. It is explicitly not a Pi-hole or AdGuard Home replacement — it lacks the dashboards and per-client analytics — but it lowers the cost of a fallback filtered DNS to roughly the price of a fast-food lunch.



