esp32·adblocker·reborndns sinkhole

A dedicated hardware DNS sinkhole on an ESP32-S3. No router addon, no SBC, no cloud.

What it is

Pi-hole proved that network-wide ad, tracker, and malware blocking belongs on a dedicated appliance instead of a brittle router bolt-on. This project takes that principle and swaps out the hardware underneath: it is a high-performance, native ESP-IDF C++ DNS sinkhole for ESP32-S3 + W5500 SPI Ethernet boards — a $15–$30 microcontroller doing the job traditionally delegated to a $50+ single-board computer, drawing under 1 Watt of wall power.

Running on constrained silicon does not mean running slow. This is a ground-up rewrite engineered for speed: it holds 800,000+ wildcard domains in external PSRAM, serves blocked verdicts and cached answers in ~1.8 ms at ~2,200 qps over a custom Layer-2 Ethernet fast path, and warm-boots its entire blocklist from an SD card cache in ~21 seconds after a power outage.

How it works

DNS queries never hit slow userspace socket stacks when they can be intercepted earlier. An L2 Ethernet tap catches UDP port 53 frames directly off the W5500 SPI interface, parses the DNS qname, runs a 40-bit Murmur3 hash lookup against the PSRAM domain table, and transmits the sinkhole reply (0.0.0.0) directly back to the physical wire.

LAN Clients PCs, Phones, Smart TVs L2 Ethernet Fast Path W5500 SPI Frame Filter 800k+ PSRAM Hashes 40-bit Murmur3 Wildcards Lookup ~1.8 ms 0.0.0.0 Sinkhole Wire-speed drop Forward Cache / lwIP TTL Memory + Rewrites Encrypted DoT TLS:853 (Quad9/1.1.1.1) FAT32 MicroSD Cache Warm boot ~21s reload UDP:53 Inspect Match Miss TCP:853 Snapshot
Hardware packet flow: L2 Ethernet fast path drops ads on the wire, resolving allowed domains via DNS-over-TLS.

Queries for legitimate domains bypass the sinkhole without penalty: the forward cache answers recurring lookups instantly, while misses are pipelined over encrypted DNS-over-TLS (DoT, port 853) to Cloudflare or Quad9, shielding your browsing from upstream ISP surveillance.

Client ESP32-S3 DoT:853 Upstream 1. Query tracker.ad.com Hash match (~1.8ms) 2. Reply 0.0.0.0 (Sinkholed) 3. Query wikipedia.org (Cache Miss) 4. TLS Query (DoT) 5. TLS Answer (208.80.154.224) 6. DNS Answer + Cache Stored
Call flow sequence: Ad queries sinkholed immediately; legitimate queries resolved over encrypted DoT.

Quickstart

1. Flash the board: Connect your ESP32-S3 over USB-C and open the browser flasher (Chrome, Edge, or Opera on desktop). Choose your board model and flash in one click. No toolchain or IDF installation required.

2. Connect Ethernet & Power: Plug an RJ45 cable from your switch or router into the board. Power via USB-C or 802.3af PoE (LilyGO T-ETH-Elite). The board boots, obtains an IP via DHCP, and announces itself via mDNS:

https://esp32adblock.local   # LilyGO T-ETH-Elite
https://esp32adblock2.local  # Waveshare ESP32-S3-ETH

(No Ethernet? If disconnected, the board launches a temporary setup Wi-Fi network named ESP32AdBlock-Setup at https://192.168.4.1).

3. First-Boot Wizard: Open your browser to the local URL. Accept the self-signed ECDSA certificate warning, set your admin credentials, and verify your network configuration.

4. Protect your network: Log into your home router's admin panel, navigate to DHCP / LAN Settings, and set the Primary DNS Server to the IP address of your ESP32 AdBlocker. Reboot your router or renew device DHCP leases to protect your entire network instantly.

Features

Hardware

Image / BoardProcessor & EthernetKey Capabilities
LilyGO T-ETH-EliteESP32-S3 + W5500 SPI PHYPoE (802.3af), MicroSD card slot. The reference hardware choice.
Waveshare ESP32-S3-ETHESP32-S3 + W5500 SPI PHYCompact footprint, MicroSD slot, USB-C powered.
Generic ESP32-S3 Wi-FiESP32-S3 (Internal Wi-Fi)Wireless fallback for travel, portable demo bags, and temporary subnets.

Pin maps, schematics, and hardware notes are detailed in the project repository.

Read this before you plug it in

Releases

The current stable release is published on the Releases page and available directly in the browser flasher. Release binaries carry RSA-3072 signatures verified by the onboard bootloader.

Further reading

Frequently asked questions

What does an ESP32 ad blocker do?

It runs as a DNS sinkhole for your whole network. You point your router's DNS at the board, and it answers lookups for ad, tracker and malware domains with a block response, for every device, with no app on each one.

Which boards are supported?

The default build is the LilyGO T-ETH-Elite, and there is a Waveshare ESP32-S3-ETH build. Both use an ESP32-S3 with a W5500 Ethernet controller. A Wi-Fi-only build runs on plain ESP32-S3 boards with PSRAM, without Ethernet or an SD card.

How many domains can it block?

More than 800,000 wildcard domains, held in PSRAM as compact hashes.

How fast is it?

On wired Ethernet the README measures about 1.8 ms per query for blocked and cached answers, and about 2,200 queries per second at saturation. Uncached queries are forwarded upstream and take about one gateway round trip, roughly 40 ms in that test.

How much power does it use?

About 1 W, according to the README.

How do I install it?

Open the browser flasher in Chrome, Edge or Opera, connect the board over USB-C, click Connect, and choose Full Flash. Plug in the Ethernet cable, open esp32adblock.local in a browser, and create an admin login in the first-boot wizard. Last, set your router's primary DNS server to the board's IP address.

What if a site I need gets blocked?

Type the domain into the Check domain box on the Dashboard, and if it shows as blocked, add it to the Whitelist. Whitelist entries take effect immediately, with no reboot.

Can it encrypt upstream DNS?

Yes. Turn on DNS-over-TLS in the Upstream DNS tab. The defaults are Cloudflare (1.1.1.1) and Quad9 (9.9.9.9). Local names such as .lan, .local and .home.arpa still go to your router in plain DNS.

Do I need a microSD card?

No, but the README recommends one. Without a card the board downloads the blocklist again on every boot, which can take minutes. With a card it restores the list from storage in seconds.