Debian 11 配置 DNS over HTTPS(DoH)

close other dns server if necessary

systemctl stop systemd-resolved
systemctl disable systemd-resolved

redirect local dns

echo "nameserver 127.0.0.1" > /etc/resolv.conf

use dnss to perform DoH

apt install dnss

dnss –help
/etc/default/dnss
default is using google dns
https://dns.google/dns-query
https://doh.dns.sb/dns-query

change to cloudflare DNS

sed -i 's#--enable_dns_to_https#--enable_dns_to_https --https_upstream=https://1.1.1.1/dns-query #g' /etc/default/dnss
systemctl restart dnss

test

apt install dnsutils -y
dig jd.com

Leave a Reply

Your email address will not be published. Required fields are marked *