This $2 ESP32-C3 Uses Flash Storage to Build a DNS Ad Blocker for 140,000+ Domains With Just 50 KB RAM

Published  October 9, 2026   0
User Avatar Vedhathiri
Author
ESP32-C3 Microcontroller Blocking Ads On Network

The ESP32-C3 AdBlock is an open-source project that turns a low-cost ESP32-C3 microcontroller into a DNS-based ad blocker and tracker system. DNS helps devices find the IP addresses of websites and online services. This project checks DNS requests against a blocklist of known advertising and tracking domains. If a domain is blocked, the ESP32-C3 returns 0.0.0.0 instead of its real IP address. Requests for allowed domains are forwarded to an upstream DNS server. Once configured as a device's DNS resolver, it can filter requests from compatible phones, computers and smart devices without requiring a separate browser extension on each one.

The project's main highlight is its low memory usage. Instead of storing full domain names, the firmware converts them into compact 40-bit FNV-1a hashes, with each hash taking just five bytes. These hashes are stored in sorted order in flash memory, allowing the ESP32-C3 to search for a match using binary search rather than checking every entry individually. According to the project's documentation, more than 140,000 domains can fit in around 0.7 MB of flash while using roughly 50 KB of RAM. The project reports lookup times of around 10 milliseconds, including the Wi-Fi round-trip time. A web dashboard also lets users manage settings, add blocked domains and update the blocklist over Wi-Fi.

The ESP32-C3 AdBlock can help reduce connections to known advertising and tracking domains on devices configured to use it, but it cannot block every ad or tracker. Unlike browser extensions, it cannot inspect webpages or hide individual ad elements. Ads served from the same domain as website content may still appear, while apps that use encrypted DNS, hard-coded IP addresses or other DNS routes may bypass its filtering. Users must install the firmware and configure their devices or network to use the ESP32-C3 as a DNS resolver. Despite these limitations, the project shows how efficient data storage and searching can bring basic network-level ad filtering to an inexpensive microcontroller without requiring a dedicated computer.

Add New Comment

Login to Comment Sign in with Google Log in with Facebook Sign in with GitHub