AI summary
Local VPN-based DNS proxy that blocks ads and tracking domains with customizable blocklists, concurrent upstream queries, and response caching. Version 3.2.3 improves cache handling, query performance, and stability.
Generated by AI. May contain inaccuracies.
About this app
A fast local DNS filtering proxy for Android. Intercepts DNS queries via Android's VpnService, blocks ads and tracking domains using customizable blocklists, and forwards to multiple upstream servers concurrently for the fastest response.
Features
- Local VPN-based DNS Proxy — Routes only DNS traffic into the app via split-tunnel VPN, all other traffic goes through normally - Domain Blocking — Filters against AdAway-format blocklists. Supports multiple lists, add/remove/toggle, and manual refresh - Concurrent Multi-Server Queries — Sends DNS queries to all enabled upstream servers simultaneously, uses the fastest successful response - DNS Response Caching — 16,384-entry LRU cache with bounded TTL (30s–60min), stale-while-revalidate, and popular-domain prefetch - In-flight Query Deduplication — Concurrent requests for the same domain share a single upstream query - UDP Socket Pooling — Reusable socket pool per upstream server (4 per server) reduces connection overhead - Statistics — In-memory query counter with batched persistence (every 5s), live display (total, blocked, block rate, avg response time) - Dashboard — Protection status, start/stop toggle, statistics grid - DNS Server Management — Configure multiple upstream servers with enable/disable toggle - Foreground Service — Runs as a foreground service with notification and stop action - Low Overhead — Packet buffer recycling, lock-free cache, minimal allocations in hot path
How It Works
1. Creates a local VPN interface routing only traffic to virtual DNS addresses (10.10.10.10, fd00::10) 2. Reads raw IP/UDP packets from the VPN interface 3. Parses the DNS question from each packet 4. Checks against loaded blocklists — blocked domains get an immediate NXDOMAIN response 5. Checks the local LRU cache — fresh entries skip the upstream query entirely 6. Forwards to all enabled upstream DNS servers concurrently via plain UDP 7. Returns the fastest successful response, caches it, patches back into the original packet
License
Apache 2.0
What's new
- 更新内容 本次为性能修正与稳定性迭代,无新功能、无破坏性变更。
- 修复 负缓存 serve-stale 的 RFC 2308 窗口:过期 NXDOMAIN/NODATA 命中时,此前只把 SOA 记录的 RR TTL 重置为 30s,SOA MINIMUM 仍为 0;下游按 min(SOA TTL, MINIMUM) 计算后会得到 0,stale 应答实际无法被缓存 30s。现在负缓存 stale 戳记会同时写入 SOA MINIMUM,reader 与 worker 两条路径均已修正。 CNAME 链检查:anyCnameTargetMatches 单遍匹配替代先构造 target 列表再判断,行为不变,减少每次正应答的临时分配。 性能 Reader 直接服务 stale:L2 过期条目不再回退到 worker 队列,reader 线程直接完成缓存拷贝、TTL 老化和 30s stale 戳记,省去一次队列与协程调度往返;热点临期条目仍在同一把缓存锁内返回 prefetch 提示。 自适应取消轮询:竞速腿前 500ms 使用 50ms 切片,让输家尽快归还 socket;之后切到 200ms,避免健康慢查询每秒构造 20 次 SocketTimeoutException。UDP 与 TCP 读取均已应用。 热路径少分配:查询解析复用输出槽,去掉每包 Pair 与 DnsQuestion 分配;域名 String 仍按需生成(缓存 key 与拦截判断需要)。 校验和计算:IPv4 头与 IPv6 UDP 校验和去掉逐字进位分支,改为 32 位累加 + 末尾单次折叠;新增 MTU 尺寸奇数载荷回归测试,确认最大包长下不会溢出。 Socket 预热:每服务器预热 socket 4→8,突发首包更快命中预热池。 代码质量 三份 DNS 名称解析循环合并为共享的 readDnsNameInto,统一处理报文内嵌 DNS 与独立 DNS 消息的压缩指针基址。 DnsResponseCache 的 fresh/stale 命中与淘汰逻辑去重为 freshHitLocked / staleHitLocked。 删除无调用的 extractCnameTargets 与 readDnsNameFromPacket。 README / AGENTS 同步 reader stale 快路径、负缓存 SOA MINIMUM 与自适应轮询说明。 测试 新增负缓存 stale TTL/MINIMUM、默认不触碰 SOA MINIMUM、压缩 QNAME、截断/空 QNAME、getOrStale prefetch 标志、MTU 尺寸 checksum 等回归测试。 全部单元测试通过;release 构建通过。
About this version
- Version
- 3.2.3 (43)
- Size
- 2.79 MB
- Requires Android
- 10
- Target SDK
- 29
- Architecture
- arm64-v8a, armeabi-v7a, x86, x86_64
- Downloads
- 27
- Updated
- Oct 26, 2026
- Package
- com.deatrg.dnsfilter
Similar apps
Ratings & reviews
- 50
- 40
- 30
- 20
- 10