DNS over TLS
Android 9 添加了新功能"私密dns", 也就是DNS over TLS (DOT)。本文介绍如何使用docker搭建dot服务器。
前期准备
- 安装docker-ce https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/
- 配置docker支持ipv6 https://docs.docker.com/v17.09/engine/userguide/networking/default_network/ipv6/
- 准备tls证书,没有证书的可以使用 https://acme.sh
- 域名解析到服务器
创建镜像
git clone https://github.com/kamino-space/DnsOverTls.git
cd DnsOverTls/config
# 复制证书文件cert.pem和cert.key到此目录,可以修改unbound.conf文件
cd ..
docker build -t dot:test .
创建容器
# 测试是否能正常运行
docker run --rm dot:test
# 没有错误,ctrl+c 退出
docker run -d -p 53:53/udp -p 853:853 -v ~/dnsconf:/usr/local/etc/unbound/local.d --restart always --name dns dot:test
测试服务器
安装kdig(旧版本不支持+tls,可自行编译安装)。
执行以下命令,查看是否正常
kdig +tls @your_domain www.google.com -d
添加记录
~/dnsconf 目录内添加.conf文件,按照文档添加记录。
https://nlnetlabs.nl/documentation/unbound/unbound.conf/#local-data
然后重启容器
docker restart dns
手机上使用
设置私密dns,填入域名。
文章评论