What can you grab for $5? A sandwich and a soda? Why not spend that on something that can make your lives better – An ad blocker?
Demonstrated by a developer from Egypt, ‘ZedAxis’ transformed a tiny ESP32-C3 SuperMini microcontroller into a fully functional DNS ad blocker that can block more than 537,000 domains with roughly 10 ms response latency. For some context, this little thing only has 400 KB of RAM and 4 MB of flash storage; how about that.
The obvious question is: how do you fit half a million blocked domains into a device with only 4 MB of flash?
Well, a plain-text blocklist is far too large, so the project converts every domain into a 40-bit FNV-1a hash. A 32-bit hash would create too many collisions, while a 64-bit hash would waste valuable storage space. During the build process, public blocklists are downloaded, duplicate entries and comments are removed, each domain is hashed, the hashes are sorted, and the final database is written directly into the ESP32’s flash memory.
When a DNS request arrives, the ESP32 hashes the requested hostname the same way and performs a binary search through the sorted hash table. If a match is found, the request is blocked. If not, the query is forwarded to an upstream DNS resolver. According to the developer, the firmware uses only around 50 KB of RAM while handling blocked lookups in roughly 10 milliseconds.
There is another neat trick hidden in the design. ESP32 devices normally reserve enough flash storage for two complete firmware images so they can perform safe over-the-air (OTA) updates. If you disable OTA updates, that second firmware partition can be reused for the blocklist database. So you’re looking at about 250K+ blockable domain slots with OTA on, and the 537K+ number you saw earlier with OTA off.
It does have its own trade-offs, though – No per-device statistics, historical query logs, detailed dashboards, or advanced filtering controls. But hey, it is easy and cheap to make one.
And the project was never intended to replace a full Pi-hole or AdGuard Home setup. The guy already runs Pi-hole on a Raspberry Pi as his main DNS server. The ESP32 exists purely as a backup resolver so that if the Raspberry Pi is rebooting, updating, or otherwise unavailable, the home network still gets filtered DNS responses instead of falling back to an unfiltered public resolver.

ZedAxis also showed off the ESP32 being plugged at the back of his gateway device, with the USB connection providing only the required 5V power while all networking is handled by the ESP32’s built-in Wi-Fi. Ad blocking while keeping the setup clean? Sign me up.
While I don’t expect the sudden surge of mass-produced “copycats” shipping out from China, the proof of concept is legit. Practical engineering doesn’t always mean pushing the budget limit, but rather, how much one can do with very few resources.



