设备如何自动发现加密 DNS
How a device finds encrypted DNS by itself

原始链接: https://blog.dundns.eu/posts/ddr-encrypted-dns-discovery/

指定解析器发现(DDR)是一种允许网络设备自动从非加密的普通 DNS 升级到加密协议(如 DoH、DoT 或 DoQ)的机制。 标准的 DNS 配置依赖于简单的 IP 地址,缺少加密所需的域名和端口信息。通过 DDR,设备会查询一个预留域名(`_dns.resolver.arpa`),询问当前的解析器是否提供加密端点。解析器随后返回必要的连接详情(包括协议、端口和 IP 地址),从而使设备能够发起加密连接。高级解析器甚至可以利用此过程立即应用特定的用户配置文件或过滤规则。 DDR 对于无法手动配置的设备(如智能家电或游戏主机)尤为有利,使其能够自动转换为安全 DNS。然而,由于初始发现请求是通过非加密 DNS 进行的,因此这被视为一种“机会性”升级;如果网络干扰了该请求,设备会直接回退到普通 DNS。虽然手动直接配置依然是最安全的方法,但 DDR 为缺乏高级 DNS 设置的设备提供了一种重要的流量安全自动化方案。

Hacker News 新闻 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 设备如何自行发现加密 DNS (dundns.eu) 8 分,由 majorchord 在 1 小时前发布 | 隐藏 | 过往 | 收藏 | 1 条评论 帮助 WarOnPrivacy 6 分钟前 | 下一条 [–] 查询 _dns.resolver.arpa(这是一个预留名称),用于询问是否存在加密版本以及可以在何处访问它。 太棒了!我们来试试:nslookup _dns.resolver.arpa [我的设备] unblound.lan 找不到 _dns.resolver.arpa:不存在的域名 [1.1.1.1] 找不到 _dns.resolver.arpa:不存在的域名 [8.8.8.8] 对于 _dns.resolver.arpa,没有可用的 IPv4 和 IPv6 地址 (A+AAAA) 记录 [9.9.9.9] 名称: _dns.resolver.arpa 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请加入 YC | 联系 搜索:
相关文章

原文

A device is normally configured with a single IP address for its DNS resolver. That address reaches the resolver over plain, unencrypted DNS, which is all a bare IP address can describe. Encrypted DNS requires more: a hostname to check the certificate against, a port, and a protocol. None of that fits in the settings box, and none of it can be worked out from the address already sitting there.

DDR, short for Discovery of Designated Resolvers, gives a resolver a way to publish those details to any device already talking to it.

How the question works

The question is a lookup for _dns.resolver.arpa, a name reserved for this purpose and answered by whichever resolver the device is currently using. It amounts to asking whether an encrypted version exists, and where it can be reached.

A resolver that has one replies with the hostname, port, and protocol of each encrypted endpoint it offers, and marks each with a preference. A device that speaks several protocols follows that preference order; a device that speaks one takes the endpoint matching it. The endpoints on offer are usually some mix of DoH, DoT, and DoQ, which an earlier post compares. Where a resolver offers no encrypted endpoints, the reply says so explicitly.

The device then opens a connection to whichever endpoint it picked, and every query from that point on is encrypted. Windows 11 and Apple devices send the question automatically when they join a network.

What comes back

The contents of that reply depend on how the resolver is built. A resolver that applies the same filtering to everybody publishes one set of endpoints, and every device receives an identical answer.

A resolver that keeps per-profile settings can answer with endpoints belonging to the profile that asked, so the blocking rules, allow lists, and logging settings configured on that profile apply from the first encrypted query onward.

Answering that way depends on the resolver identifying the profile behind the question. A query arriving over an existing encrypted connection identifies itself, because the profile is part of how that connection was established in the first place. A query arriving over plain DNS carries no such marker, leaving its source address as the only available signal, so that address has to be linked to the profile in advance. Queries from an unlinked address get a reply listing no endpoints.

The reply also includes the IP addresses of the endpoints it names, which saves the device a second lookup to resolve the hostname it has just been handed. That lookup would otherwise travel over the same unencrypted connection the device is trying to leave.

Where it helps most

A device that is already encrypted. A browser on DoH or a phone on DoT can send the same question and learn that DoH3 and DoQ are available. The exchange happens inside a connection that is already encrypted and certificate-verified, so the upgrade inherits that verification. A device identified by name on its existing connection keeps that name across the switch, since the name travels with the connection.

A device limited to plain DNS. Televisions, consoles, and appliances that accept an IP address and nothing else can be moved onto an encrypted connection with no configuration of their own.

What it does not do

An upgrade starting from plain DNS begins with an unencrypted exchange, which the network can read and alter. A network operator intent on keeping DNS unencrypted can strip or rewrite the reply, and the device has no way to detect it. Clients treat this route as opportunistic for that reason, taking the upgrade when it succeeds and continuing on plain DNS when it fails. Stricter clients go further and require the designated endpoint’s certificate to name the IP address they started from, declining the upgrade when it does not.

Configuring an encrypted resolver directly on a device remains the stronger option wherever the settings allow it, since the connection is verified from the first query and travels with a laptop or phone onto any network. Many routers can configure one on behalf of everything behind them. DDR covers the devices that neither route reaches.

联系我们 contact @ memedata.com