Cloudflare 提供了一个叫做 cloudflared 的工具,利用这个工具,可以轻松在系统中配置 DNS over HTTPS 客户端。这里以 Windows 为例。
首先,下载 cloudflared 二进制文件(来自官方)
解压,得到 cloudflared.exe。
由于需要监听 53 端口,启动一个管理员权限的 cmd 或 Powershell,定位到 cloudflared.exe 所在目录
执行 cloudflared.exe proxy-dns (cmd)
或 .\cloudflared.exe proxy-dns (Powershell)
此时,cloudflared.exe 已经开始监听 53 端口了。打开 Windows 网络适配器设置,并将主 DNS 设置为 127.0.0.1 即可通过 DoH 方式连接 1.1.1.1 或 1.0.0.1。
若需要配置开机启动,参考 Automatically Starting Argo Tunnel
若需要使用其他 DoH IP,或配置开机启动,需要一个配置文件 config.yaml
这里给出一个例子:
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query