How s60sc/esp32_adblocker works
ESP32_AdBlocker is an ESP32 DNS sinkhole with a browser-based control and monitoring interface. DNS clients send queries to the device; the DNS service checks the in-memory blocklist, returns sinkhole responses for matches, and resolves other names through upstream DNS. Operators configure networking and blocklist sources, reload or stop downloads, and manage custom allow/block entries through the web UI. The README also documents Ethernet/Wi-Fi modes, WebDAV, OTA, logging, and LED status. Some subsystem links are based on documented capabilities because their implementation was not sampled.
Main entry points: webServer.cpp HTTP and WebSocket · externalDNS.cpp DNS query service · appSpecific.cpp Blocklist download · ESP32_AdBlocker.ino Application startup
Components 20
DNS service
- DNS query service
externalDNS.cpp
Blocklist management
- Blocklist lookup
appSpecific.cpp - Blocklist download
appSpecific.cpp - Custom domains
appSpecific.cpp - Blocklist snapshots
appSpecific.cpp
Web control
- Control web UI
data/AdBlocker.htm - UI behavior
data/common.js - HTTP and WebSocket
webServer.cpp - Configuration
prefs.cpp - WebDAV access
webDav.cpp
Device services
- Config and files
prefs.cpp - First-run setup
setupAssist.cpp - Network services
utils.cpp - Logging
utilsLog.cpp - Application startup
ESP32_AdBlocker.ino - Status LED
appSpecific.cpp
Other components
- DNS client
- Upstream DNS
- Blocklist source
- Browser operator
Connections 25
- DNS client → DNS query service: queries
- DNS query service → Blocklist lookup: checks domain
- DNS query service → Upstream DNS: resolves misses
- DNS query service → DNS client: DNS replies
- Blocklist source → Blocklist download: provides list
- Blocklist download → Blocklist lookup: builds list
- Blocklist download → Blocklist snapshots: saves snapshot
- Blocklist lookup → Custom domains: applies overrides
- Browser operator → Control web UI: opens
- Control web UI → UI behavior: loads scripts
- UI behavior → HTTP and WebSocket: requests status and actions
- HTTP and WebSocket → Configuration: updates settings
- HTTP and WebSocket → Blocklist download: controls reload
- HTTP and WebSocket → Custom domains: manages domains
- HTTP and WebSocket → Logging: serves logs
- HTTP and WebSocket → WebDAV access: routes WebDAV
- Configuration → Config and files: persists settings
- WebDAV access → Config and files: reads and writes files
- First-run setup → Config and files: downloads web files
- First-run setup → Network services: uses connectivity
- Application startup → Network services: starts networking
- Application startup → DNS query service: starts DNS
- Application startup → Configuration: loads settings
- Application startup → Status LED: updates status
- Blocklist download → Logging: reports progress