admin管理员组

文章数量:1563536

Win11

Win11已原生支持DoH,参考这篇:启用Win11原生支持的DoH(DNS over HTTPS)

本文Win10的使用cloudflared实现,其他的工具比如smartdns也可以,但是无法在原生Win10运行,需要借助WSL,AdguardTeam/dnsproxy 也可以实现在Win10上使用DoH,使用方法可以自行研究

方法一

适用范围

版本低于Windows 10 build 19628的

版本可以通过键盘Win+R,然后输入winver查看
OS 内部版本 小于19628的因为系统不支持,所以只能采用方法一

建议目前直接用这个方案就可以了,简单稳定,好配置

操作

我们使用的项目:https://github/cloudflare/cloudflared

  1. 从https://github/cloudflare/cloudflared/releases下载对应的系统版本,我下载的是cloudflared-windows-amd64.exe
  2. 进入存放cloudflared-windows-amd64.exe的目录,管理员权限开启powershell
  3. 运行:.\cloudflared-windows-amd64.exe service install
  4. 新建一个配置文件D:\OneDrive\Tools\Win\Network\DoH\config.yml(任意位置都可以),内容如下:
proxy-dns: true
proxy-dns-upstream:
  - https://223.5.5.5/dns-query
  - https://doh.pub/dns-query
  - https://1.1.1.1/dns-query
  - https://doh.opendns/dns-query
  - https://dns.google/dns-query
  1. 修改注册表,注册表路径HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cloudflared,在ImagePath后面添加--config "<path-to-config>"
  2. powershell执行Start-Service Cloudflared
  3. 修改网卡DNS为127.0.0.1

验证

网卡抓取本地环回地址,过滤DNS协议,验证DNS解析到本地cloudfared服务:

网卡抓包外网网卡到223.5.5.5的通信都是TLS的:

DoH服务器列表

国内DoH服务器列表:
https://223.5.5.5/dns-query
https://223.6.6.6/dns-query
https://dns.alidns/dns-query
https://doh.pub/dns-query
https://doh.360/dns-query

国外DoH服务器列表:
https://dns.google/dns-query
https://dns.quad9/dns-query
https://doh.opendns/dns-query
https://1.1.1.1/dns-query
https://1.0.0.1/dns-query
https://cloudflare-dns/dns-query
https://dns.adguard/dns-query

参考链接

https://www.v2ex/t/596816
https://developers.cloudflare/cloudflare-one/connections/connect-apps/run-tunnel/run-as-service

方法二

适用于win10版本大于等于19628的系统,不建议使用,太麻烦了,而且目前没有标准化的流程,建议等win11出了就好了
参考下列网址配置:
https://www.jb51/os/win10/725523.html
https://techcommunity.microsoft/t5/networking-blog/windows-insiders-can-now-test-dns-over-https/ba-p/1381282

本文标签: 何为DOHdnsHTTPS