1)下载安装包
https://github.com/pymumu/smartdns/releases/tag/Release43
2)解压,授权,安装
tar zxf smartdns.1.2023.08.11-1937.x86-linux-all.tar.gz
cd smartdns
chmod +x ./install
bash ./install -i
3)修改配置文件
vim /etc/smartdns/smartdns.conf
添加
server 8.8.8.8
address /xxxxxx.com/192.168.xxx.xxx
每次修改都要重启服务
systemctl restart smartdns
其他命令
systemctl start smartdns
systemctl stop smartdns
systemct enable smartdns
检查状态
smartdns status
4)上面已完成域名服务器的搭建,如果想在局域网内起效,需要修改路由器的dns所在的ip:
DHCP-DNSType-DNS服务器:
第一个写域名服务器所在的内网ip
第二个写上游dns,中间用空格隔开,这个根据路由器的类型设置
如:
192.168.xxx.xxx 8.8.8.8