1、下载并安装

# 下载
wget https://github.com/pymumu/smartdns/releases/download/Release43/smartdns.1.2023.08.11-1937.x86_64-linux-all.tar.gz

# 解压并安装
tar xf smartdns.1.2023.08.11-1937.x86_64-linux-all.tar.gz
cd smartdns
chmod +x ./install
./install -i

2、修改配置文件(仅供参考)

# vim /etc/smartdns/smartdns.conf 
bind :53
bind-tcp :53
cache-size 32768
cache-persist yes
cache-file /tmp/smartdns.cache
serve-expired yes
serve-expired-ttl 259200
serve-expired-reply-ttl 30
speed-check-mode ping,tcp:80,tcp:443
force-qtype-SOA 65
log-level info
server 119.29.29.29
server 223.5.5.5
server 114.114.114.114
server 8.8.8.8
server-tls 8.8.8.8
server-tls 1.1.1.1
address #6
address /wiki.example.com/10.10.10.99
address /reg.example.com/10.10.10.100

3、启动服务

systemctl enable --now smartdns

4、解析测试

# 安装测试工具
dnf install bind-utils -y

# 检查服务配置
nslookup -querytype=ptr smartdns

# 域名解析测试
dig -t A wiki.example.com

nslookup reg.example.com

参考:

https://pymumu.github.io/smartdns/

  

posted on 2024-01-19 15:18  a120608yby  阅读(85)  评论(0编辑  收藏  举报