Clever hacker fits 537,000 domains in a tiny $5 ESP32 ad-blocking dongle — firmware uses only around 50KB of RAM and can answer blocked lookups in 10 milliseconds
This project uses a clever hashing trick to fit over half a million blocked domains into just 4MB of flash memory.
When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works.

Copy link
X
How cheap can you build a hardware-based ad-blocking DNS filter? "Free," if you're willing to salvage some used hardware that's being thrown away. What if you aren't so lucky? In the era of the RAMageddon, even a Raspberry Pi will cost you a couple hundred bucks. But you know, you don't even need something that powerful. In fact, you can use a $5 microcontroller to build a fully functional ad-blocking filter with over 500,000 domains blocked and around 10ms latency.
a fully functional ad-blocking filter
We know that's possible because Egyptian full-stack developer ZedAxis (@M-Abozaid on GitHub) has already built one. Using an ESP32-C3 "SuperMini" board, he's created a backup DNS for his home network that still provides ad blocking. His primary router is a Pi-hole, which is a Raspberry Pi running specialized software to manage DHCP addressing and DNS resolution with integrated ad-blocking. The SuperMini serves as a backup when the Pi-Hole is rebooting or otherwise unavailable.

Strictly speaking, we haven't seen ZedAxis' creation in action, but there's no reason to believe it doesn't work. The ESP32 family of embedded Wi-Fi-enabled microcontrollers is a well-known quantity, and this functionality is by no means outside the realm of its capabilities. In fact, this specific trick allows the use of the ESP32-C3, which is a cost-reduced version of the chip that doesn't have the 8MB of PSRAM found on some higher-end models. (There are MANY variants of the ESP32.)
[Watch full video here:]()
Instead, the ESP32-C3 used by ZedAxis has just 400KB of RAM, and 4MB of flash memory. With these limited specifications, he wasn't able to store a plaintext blocklist of any real size; it's simply too much data. So, he did what any enterprising hacker would do: he started hashing the data to reduce its size. Using 40-bit FNV-1a hashes, because 32-bit would give too many collisions and 64-bit wastes too much space, he can store some 537,000 domains in the flash memory of the device.

The clever part isn't really the hashing, though. Rather than storing the domains themselves, the build process downloads one or more public blocklists, strips out duplicate entries and comments, hashes each remaining domain into a 40-bit value, sorts the resulting list, and writes the finished database into the ESP32's flash memory. When a DNS query arrives, the device hashes the requested hostname the same way and performs a binary search against the sorted hash table. If it finds a match, the request is blocked. Otherwise, the query is forwarded to an upstream resolver. According to ZedAxis, the finished firmware uses only around 50KB of RAM while answering blocked lookups in roughly 10 milliseconds.
Tiny credit card computer includes eInk screen and is just 1mm thick
Tiny credit card computer includes eInk screen and is just 1mm thick

Designer turns discontinued E-Ink dev board into a 60Hz Game Boy handheld
Designer turns discontinued E-Ink dev board into a 60Hz Game Boy handheld

Wi-Fi controlled hacking USB cable stealthily packs in a microcontroller, microSD storage, and more
Wi-Fi controlled hacking USB cable stealthily packs in a microcontroller, microSD storage, and more


There's another neat compromise hiding in the design, too. The ESP32 normally reserves enough flash memory to hold two complete copies of its firmware, allowing over-the-air (OTA) updates without risking a failed flash leaving the device unbootable. If you don't care about wireless firmware updates, you can reclaim that second firmware partition for the blocklist database instead. With OTA support enabled, the project tops out at around 250,000 blocked domains. Give up OTA, and that jumps to roughly 537,000 domains on a microcontroller that you can usually buy for the price of a fast-food lunch. ZedAxis describes the price as $2; I wasn't able to find SuperMini boards any cheaper than about $5 US, but at that price there's not much need to quibble about the difference.
the price of a fast-food lunch
Of course, this isn't meant to replace a proper Pi-hole or AdGuard Home installation. The ESP32 project has a rudimentary dashboard, but it doesn't provide detailed per-client statistics, historical query logs, or all the knobs and dials that make those platforms attractive. Instead, it's designed as a tiny insurance policy. It sits quietly on the network, sips only a few dozen milliamps of power, and if the primary DNS server disappears for a reboot or a power outage, clients still get filtered DNS responses instead of falling back to whatever resolver the router happens to have configured.
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.

My favorite detail is that ZedAxis powers the whole thing from the USB port on the back of his ISP-provided fiber gateway, a Huawei OptiXstar home fiber gateway. The USB connection isn't carrying any data; the totality of the integration is the router saying "here's 5 volts" and the ESP32 replying "thanks." It's just that the port is a convenient power source for a device so small it practically disappears behind the router. All communications are carried out through the ESP32's integrated Wi-Fi adapter.
I have no idea whether projects like this will ever become common. Probably not, because most people who want network-wide ad blocking will still buy a Raspberry Pi, a used mini PC, or run AdGuard Home in a virtual machine. Still, it's refreshing to see somebody look at a $5 microcontroller with 400KB of RAM and decide, "Sure, that'll do."

Follow Tom's Hardware on Google News, or add us as a preferred source, to get our latest news, analysis, & reviews in your feeds.

Zak is a freelance contributor to Tom's Hardware with decades of PC benchmarking experience who has also written for HotHardware and The Tech Report. A modern-day Renaissance man, he may not be an expert on anything, but he knows just a little about nearly everything.
[Maker and STEM
Wi-Fi controlled hacking USB cable stealthily packs in a microcontroller, microSD storage, and more](https://www.tomshardware.com/maker-stem/microcontrollers-projects/wi-fi-controlled-hacking-usb-cable-stealthily-packs-in-an-esp32-s3-microsd-storage-and-more-cable-can-execute-remote-payload-execution-keystroke-injection-and-more-but-is-built-for-makers-developers-enthusiasts-and-cybersecurity-learners)

[Cybersecurity
Arrest and extradition of Scattered Spider hacker shines light on how Windows telemetry GDIDs can identify and track users](https://www.tomshardware.com/tech-industry/cyber-security/arrest-and-extradition-of-scattered-spider-hacker-shines-light-on-how-windows-telemetry-gdids-can-identify-users-microsoft-device-identifier-is-just-one-digital-fingerprint-in-a-software-world-rife-with-them)

[DRAM
Meta fights soaring hardware costs by reusing old DDR4 server memory in new DDR5-only servers](https://www.tomshardware.com/pc-components/dram/meta-fights-soaring-hardware-costs-by-reusing-old-ddr4-server-memory-in-new-ddr5-only-servers-custom-cxl-2-0-chip-marries-legacy-ddr4-2400-with-cutting-edge-ddr5-6400)

[Networking
Flipper One computing multitool bristles with network, GPIO, and M.2 connectivity](https://www.tomshardware.com/networking/flipper-one-computing-multitool-bristles-with-network-gpio-and-m-2-connectivity-new-keychain-device-is-also-a-fully-open-arm-linux-computer)

[Storage
RAMpocalyse pricing prompts maker to construct his own memory using ancient Apollo-era tech](https://www.tomshardware.com/pc-components/storage/rampocalyse-pricing-prompts-maker-to-construct-his-own-memory-using-ancient-apollo-era-tech-usb-drive-resurrects-hand-threaded-magnetic-core-memory-using-salvaged-russian-computer-parts)

[Gift Guides and Seasonal Sales
Best Amazon Prime Day tech deals you can still get, last chance to grab savings](https://www.tomshardware.com/live/news/best-amazon-prime-day-deals-2026)

[Wi-Fi Routers
Elon Musk's Starlink releases smaller and lighter V5 residential kit](https://www.tomshardware.com/networking/routers/elon-musks-starlink-releases-smaller-and-lighter-v5-residential-kit-offers-speeds-of-up-to-375-mbps-and-almost-half-the-power-consumption-of-v4)

[Wi-Fi Routers
Global consumer Wi-Fi router shipments fell 6% in Q1 2026](https://www.tomshardware.com/networking/routers/global-consumer-wi-fi-router-shipments-fell-6-percent-in-q1-2026-mesh-systems-and-gaming-routers-still-prove-popular)

[Network Switches
Record-low price on this 10-port PoE+ switch with gigabit speeds and up to 60W of power, save 24%](https://www.tomshardware.com/networking/network-switches/record-low-price-on-this-10-port-poe-switch-with-gigabit-speeds-and-up-to-60w-of-power-save-24-percent-usd38-for-ugreen-switch-that-unlocks-an-extra-eight-power-delivery-ports-for-cameras-and-wi-fi-extenders)

[Networking
Fire hydrant signs with Starlink antennas tested for emergency Wi-Fi in disaster-prone Japan](https://www.tomshardware.com/networking/fire-hydrant-signs-with-starlink-antennas-tested-for-emergency-wi-fi-in-disaster-prone-japan-existing-widespread-grid-of-street-level-furniture-can-be-used-for-communications-network-fallback)

[Networking
China’s hollow-core fiber trial pushes 51.3 Tb/s over 128 miles without signal regeneration](https://www.tomshardware.com/networking/chinas-hollow-core-fiber-trial-pushes-51-3-tb-s-over-128-miles-without-signal-regeneration-milestone-targets-ai-era-networking-bottlenecks)

[Network Switches
TP-Link's 8-port 2.5G unmanaged Ethernet switch is a smokin' bargain at $50](https://www.tomshardware.com/networking/network-switches/tp-links-8-port-2-5g-unmanaged-ethernet-switch-is-a-smokin-bargain-at-usd50-upgrade-your-home-network-for-half-price)

[CPUs
AMD's next-gen 10-core 'Medusa Point' APU shows up on Geekbench again, with its best score yet](https://www.tomshardware.com/pc-components/cpus/amds-next-gen-10-core-medusa-point-apu-shows-up-on-geekbench-again-with-its-best-score-yet-leaked-sku-outpaces-every-other-x86-mobile-chip-in-the-single-core-test)

[Policy
Memory chip boss admits RAM prices are 'abnormally high'](https://www.tomshardware.com/tech-industry/policy/memory-chip-boss-admits-ram-prices-are-abnormally-high-sk-group-chairman-considering-building-a-semiconductor-plant-in-the-us-to-expand-supply-calm-chipflation)

[CPUs
Zilog Z80 turns 50 as an open-source replacement heads to drop-in DIP40 silicon](https://www.tomshardware.com/tech-industry/zilog-z80-turns-50-as-open-source-replacement-heads-for-drop-in-dip40-silicon)

[Drones
‘Phantom Twist’ drone spins so fast that it is nearly invisible](https://www.tomshardware.com/tech-industry/drones/phantom-twist-drone-spins-so-fast-that-it-is-nearly-invisible-flying-device-adds-motion-blur-to-the-real-world)

[Tech Industry
Samsung cuts hundreds of US consumer electronics jobs ahead of Texas HQ move](https://www.tomshardware.com/tech-industry/samsung-cuts-hundreds-of-us-consumer-electronics-jobs-ahead-of-texas-hq-move)

[Drones
Russian drones spotted using screwed-on magnetic compasses as navigation aids](https://www.tomshardware.com/tech-industry/drones/russian-drones-spotted-using-screwed-on-magnetic-compasses-as-navigation-aids-the-on-board-camera-can-occasionally-tilt-down-to-check-bearings-if-satellite-comms-are-lost)

wakuwaku
no matter how cheap a project is purported to be , as long as it requires you to either own a 3d printer, or get someone to print it for you, IT IS NOT CHEAP.
Reply
usertests
wakuwaku said:no matter how cheap a project is purported to be , as long as it requires you to either own a 3d printer, or get someone to print it for you, IT IS NOT CHEAP.An ever increasing number of people can get cheap access to a 3D printer through libraries (since nobody reads anymore) or makerspaces.
Reply
Unolocogringo
Firefox + Ghostery +Malwarebytes Browser guard, makes it simple. No hardware needed.
Spybot Anti Beacon takes care of windows telemetry.
Simple and effective.
Reply
PEnns
FireFox + UBlock Origin do it without a 3d printer. But nevertheless, kudos!!
Reply
USAFRet
wakuwaku said:no matter how cheap a project is purported to be , as long as it requires you to either own a 3d printer, or get someone to print it for you, IT IS NOT CHEAP.I print LOTS of things for friends and coworkers for $0.
Reply
krisavi
wakuwaku said:no matter how cheap a project is purported to be , as long as it requires you to either own a 3d printer, or get someone to print it for you, IT IS NOT CHEAP.
There is no NEED for 3d printer. You can print an enclosure, but you don't have to do it.
Reply
krisavi
Unolocogringo said:Firefox + Ghostery +Malwarebytes Browser guard, makes it simple. No hardware needed.
Spybot Anti Beacon takes care of windows telemetry.
Simple and effective.That is so one OS specific answer to some neat thing someone uses.
A lot of people use PiHole to block ads/domains on phones. You being able to do something on windows would not do much on phones.
This project is nice addition to keeping that blocking working while main system is updating.
Reply
darkflib
If you are hashing and binary searching, a bloom filter might be a better choice if tuned well.
Reply
View All 8 Comments