OxiDNS is a programmable, policy-orchestration DNS engine written in Rust, aimed at operators of soft routers, OpenWrt boxes, homelabs and advanced self-hosted networks who need explainable, configurable query routing.
What it is
OxiDNS is a plugin-based DNS engine built in Rust for complex networks, combining declarative policy with a WebUI, management API, query records, Prometheus metrics and live logs. It lives in the DNS/networking infrastructure space and takes direct inspiration from mosdns, but positions itself as more than rule-based split routing: it places DNS requests, upstream responses and network side effects on a single composable, explainable policy pipeline.
The concrete problem it addresses is that complex DNS behaviour usually becomes hard to configure, validate and trace once it grows past simple domain split rules. OxiDNS addresses this with sequence, which combines matchers, executors and providers into reusable conditional branches, jumps and fallback chains, while query audit records, execution paths, structured logs and metrics let you answer what matched, what ran and why a result was chosen. The core path stays simple: client → server → sequence (matcher + executor + provider) → upstream or local answer → response, with side effects branching off.
Key capabilities
- Serve UDP, TCP, DoT, DoQ and DoH (HTTP/1.1, HTTP/2, HTTP/3) through one policy, with multi-protocol upstreams, concurrent response adjudication, connection reuse,
bootstrap, SOCKS5 and a unified network.outbound.
- Orchestrate policy with
sequence: conditional matching, executor composition, jumps and fallback chains assembled from tag-combined plugins (domain_set, forward, udp_server).
- Process responses with TTL-aware cache and negative cache, ECS and ECS client-address mapping, local records, redirects, response construction, and dual-stack/IP preference.
- Load rule data from domain and IP sets, GeoIP, GeoSite, AdGuard rules and dynamic domain learning.
- Drive network behaviour from DNS results: Linux
ipset / nftset, RouterOS address-list and static route, HTTP webhooks and external scripts.
- Observe and operate it with query audit and execution paths, real-time logs, Prometheus metrics, upstream probing, health checks, config validation and hot reload, matcher result pinning and targeted provider reload.
- Deploy through multi-platform builds, Debian packages, an OpenWrt LuCI plugin (
luci-app-oxidns), a built-in WebUI and management API, and service-based installation.
Who uses it and how
- Home gateways, side routers, OpenWrt devices, NAS boxes and homelabs that run DNS long-term with fine-grained control.
- Operators routing policy by domain, client, query type or response result, with multi-upstream concurrency and primary/backup fallback.
- Environments needing encrypted DNS with a custom egress path via SOCKS5 or
network.outbound.
- People doing ad blocking, local overrides, dual-stack preference, ECS and dynamic rule learning.
- Setups where DNS results drive firewall sets, address lists or policy routing through
ipset/nftset or RouterOS.
Getting started
The README offers a one-line install that downloads the platform release, installs the WebUI and registers and starts a system service: curl -fsSL https://oxidns.org/install.sh | sudo sh, with irm https://oxidns.org/install.ps1 | iex for administrator PowerShell; Debian packages, Docker, portable installs and the OpenWrt route via luci-app-oxidns are documented under installation, and config changes should be validated with oxidns check.
How it compares
The project is GPL-3.0 licensed and self-hostable, with all policy configuration, query records and metrics kept on your own infrastructure, and it can be custom-compiled to trim protocols and plugins. Among the tools it names, it sits alongside mosdns as an inspiration, but differs by putting requests, upstream responses and network side effects on one composable pipeline rather than focusing only on rule-based split routing.
When to use it — and when not
You must be willing to learn the configuration model: providers, matchers, executors and servers are combined by tag, and after changing config you need to run oxidns check before applying it — it is explicitly not a one-click ad blocker nor an authoritative DNS service. It is also not for someone who wants to operate nothing; while the install script registers a system service and the project ships a WebUI, Debian package and OpenWrt plugin, exposing the management API requires enabling api.http.auth and constraining sources with a firewall or reverse proxy yourself. Note the project carries the GPL-3.0 licence, 15 open issues, and the README points to external documentation at oxidns.org for configuration, scenarios and benchmarks rather than carrying them inline.
project readme (upstream, from github) — read inline


中文 | English · 文档 · 快速开始 · 插件参考
OxiDNS
面向复杂网络的高性能 DNS 策略编排引擎。
OxiDNS 是一个使用 Rust 构建、面向软路由、OpenWrt、Homelab 和高级自建网络的插件化 DNS 引擎。它通过声明式策略组合匹配、缓存、转发、回退、改写、本地应答和系统联动,并提供 WebUI、管理 API、查询记录、Prometheus 指标和实时日志。
项目受 mosdns 启发,但不止于规则分流:OxiDNS 将 DNS 请求、上游响应和网络副作用放进同一条可组合、可解释的策略管线,让复杂行为仍然能够被配置、验证和追踪。
快速开始 · 配置总览 · 常见场景 · 性能与基准
为什么选择 OxiDNS
- 策略可编排:
sequence 将 matcher、executor 和 provider 组合成可复用的条件分支、跳转和回退链。
- 决策可解释:查询记录、执行路径、结构化日志和指标可以回答一次查询匹配了什么、执行了什么、为何选择当前结果。
- 接入与出口统一:同一策略可服务 UDP、TCP、DoT、DoQ 和 DoH,并统一管理上游解析、连接复用、并发裁决与代理出口。
- DNS 驱动网络行为:解析结果可以直接联动 Linux
ipset / nftset、RouterOS 地址列表与静态路由、HTTP webhook 和外部脚本。
OxiDNS 使用自有 DNS 消息模型与 wire 编解码层,并把规则编译、依赖分析和连接初始化尽可能移出请求热路径;设计方法和历史测试结果见性能与基准。
核心请求路径保持清晰:
client -> server -> sequence (matcher + executor + provider)
|-> upstream / local answer -> response
`-> side effects
策略配置是什么样的
下面的配置把 corp.lan 交给内网 DNS,其余域名使用加密上游。Provider、matcher、executor 和 server 通过 tag 组合,不需要把策略写进协议入口:
plugins:
- tag: internal_domains
type: domain_set
args:
exps: ["domain:corp.lan"]
- tag: forward_internal
type: forward
args:
upstreams:
- addr: "udp://192.168.1.1:53"
- tag: forward_public
type: forward
args:
upstreams:
- addr: "tls://dns.quad9.net:853"
bootstrap: "9.9.9.9:53"
- tag: main
type: sequence
args:
- matches: "qname $internal_domains"
exec: "$forward_internal"
- matches: "!has_resp"
exec: "$forward_public"
- exec: accept
- tag: dns_server
type: udp_server
args:
entry: main
listen: ":5335"
完整配置结构、复用规则和更多部署模板见配置总览与常见场景。
核心能力
完整的内置组件和配置字段见插件参考。
快速开始
一条命令安装最新 release,并默认注册和启动为系统服务:
curl -fsSL https://oxidns.org/install.sh | sudo sh
Windows 管理员 PowerShell:
irm https://oxidns.org/install.ps1 | iex
默认情况下,安装脚本会下载对应平台的 release、安装 WebUI,并注册和启动系统服务。
安装完成后,可以验证管理端和默认 DNS 服务:
curl -fsS http://127.0.0.1:9199/api/health
dig @127.0.0.1 example.com
dig @127.0.0.1 example.com +tcp
WebUI 默认地址为 http://服务器IP:9199/。允许其他设备访问前,请启用 api.http.auth 并通过防火墙或反向代理限制来源。修改配置后,请先使用 oxidns check 校验。
OpenWrt 会通过同一个安装脚本安装 luci-app-oxidns。完成首次查询见快速开始;手动下载、Docker、Debian 包、便携安装和卸载见文档中的“安装与部署”;按需裁剪协议和插件见自定义编译。
适合谁
OxiDNS 适合需要长期运行、精细控制和完整可观测性的 DNS 环境,例如:
- 家庭网关、旁路由、OpenWrt、NAS 和 Homelab
- 按域名、客户端、查询类型或响应结果进行策略路由
- 多上游并发、主备回退、加密 DNS 与自定义出口
- 广告过滤、本地覆盖、双栈偏好、ECS 和动态规则学习
- 由 DNS 结果驱动防火墙集合、地址列表或策略路由
它不是权威 DNS 服务,也不是无需理解配置模型的一键广告过滤面板。如果你的首要需求是开箱即用的图形化管理,其他面向该场景的产品可能更合适;OxiDNS 更适合愿意用一定配置复杂度换取控制力和可解释性的用户。
文档
项目状态
OxiDNS 仍在持续开发,适合高级家庭网络、软路由、Homelab 和其他可控的自建网络环境。用于生产或关键网络前,请完成配置与回退验证、容量评估和监控建设。DNS 配置会直接影响网络可用性,请在变更前保留可恢复的配置和旁路方案。
欢迎提交 Issue、反馈真实场景、改进文档或贡献插件。
维护者
OxiDNS 主要由 Sven Shi 创建和维护。
我目前正在关注新的职业机会,方向包括 后端工程、基础设施、网络系统,
以及涉及 Rust 的工程岗位。
如果你所在的团队正在解决类似 OxiDNS 所涉及的系统、网络或基础设施问题,
并认为我的经验可能适合,欢迎通过 Email 与我联系。
社区交流
欢迎加入 Telegram 群与作者和其他用户交流:@OXIDNS · https://t.me/oxidns
支持项目开发
如果 OxiDNS 对你有帮助,可以通过微信或支付宝支持项目的持续开发与维护。支持完全自愿,感谢每一份认可。
资金支持不会建立商业服务关系,也不会影响功能规划或问题处理的优先级。其他支持方式请参阅贡献指南。
许可证
本项目基于 GNU General Public License v3.0 or later 开源。