SmartDNS

参考原文链接:https://pymumu.github.io/smartdns/

Step 1 下载SmartDNS

1
wget https://github.com/pymumu/smartdns/releases/download/Release33/smartdns.1.2020.09.08-2235.x86_64-linux-all.tar.gz

Step 2 解压并安装

1
2
3
4
tar zxf smartdns.1.2020.09.08-2235.x86_64-linux-all.tar.gz
cd smartdns
chmod +x ./install
./install -i

Step 3 编辑配置

1
2
3
4
5
6
7
8
9
10
11
nano /etc/smartdns/smartdns.conf

server-name smartdns
bind 192.168.1.6:53
cache-size 4096
cache-persist yes
cache-file /tmp/smartdns.cache
server 223.5.5.5
server 119.29.29.29
server 101.226.4.6
server 8.8.8.8

Step 4 停止系统DNS服务

1
2
systemctl stop systemd-resolved.service
systemctl disable systemd-resolved.service

Step 5 修改/etc/resolv.conf文件

1
2
3
4
nano /etc/resolv.conf

#nameserver 127.0.0.53
nameserver 192.168.1.6

Step 6 启动服务

1
2
systemctl enable smartdns
systemctl start smartdns

Step 7 验证服务

1
2
3
4
5
6
7
8
nslookup -querytype=ptr smartdns

$ nslookup -querytype=ptr smartdns
Server: 192.168.1.6
Address: 192.168.1.6#53

Non-authoritative answer:
smartdns name = smartdns.

Step 8 检查结果

1
2
3
4
5
6
7
8
9
10
nslookup www.baidu.com 192.168.1.6

$nslookup www.baidu.com 192.168.1.6
Server: 192.168.1.6
Address: 192.168.1.6#53

Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 36.152.44.95
文章作者: Barry
文章链接: http://blog.purplelin.com/2021/03/21/SmartDNS/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Barry