openwrt上配置doh,让全体用上doh (内有新解决方案)

dns 是非常古老的协议,非常容易劫持 容易泄露隐私。主要是劫持这点非常不方便。

doh 也就是 dns over https,就是让dns协议去走https协议,可以完全防止dns污染,也防止隐私泄露。主流系统都一直支持自行配置,但是在每台设备上弄 还是麻烦。 所以 还是弄到路由器上省心。

本文停止更新,新文章优化解决方案:

# passwall2 方案简单容易且靠谱

https://dev.leiyanhui.com/openwrt/passwall2

# ssrp+smartdns 略微麻烦

https://dev.leiyanhui.com/openwrt/ssr_doh

# openclash 自由 强大

https://dev.leiyanhui.com/openwrt/openclash

如果可以接受openclash的繁琐,还是建议openclash,自由,强大 :

安装插件https-dns-proxy

1
2
3
4
5
6
#核心
opkg install https-dns-proxy
#网页界面
opkg install luci-app-https-dns-proxy 
#中文
opkg install luci-i18n-https-dns-proxy-zh-cn

中文语言包 好像失效了。找到一个 https://openwrt.pkgs.org/19.07/openwrt-luci-x86_64/luci-i18n-https-dns-proxy-zh-cn_2021-07-29-1-1_all.ipk.html

注意 https-dns-proxy 安装后会默认启动,并接管dns,且默认使用google和cf的dns 墙内肯定 会导致全局网络无法dns,需要尽快去配置为国内可用的。

# 常用doh服务商

测试

1
2
curl --http2 -H 'accept: application/dns-json' https://1.1.1.1/dns-query?name=cloudflare.com
curl https://dns.alidns.com/resolve?name=taobao.com

# 境内

腾讯/dnspods https://doh.pub/dns-query" 阿里云 https://dns.alidns.com/dns-query

# 另外说一下阿里云的doh

阿里云的doh会强制显示client ip,google cf等没有这情况。但是总所周知,google和cf 都相对比较慢一些,而且需要你有网络学习环境。
目前阿里云的doh在手动指定 client-subnet的时候设置为墙外ip会返回没有污染的结果。 这个小漏洞的起因应该是阿里云在墙外有上级纯净的权威dns

但是我们可以在墙内使用阿里云doh来获取没有污染的结果。

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计