温馨提示

  • 下面以 x86_64 为版本举例

软件包

根据系统版本下载对应的版本,更多版本请前往:https://github.com/pymumu/smartdns/releases/tag/Release47

https://github.com/pymumu/smartdns/releases/download/Release47/smartdns.1.2025.09.18-2244.aarch64-debian-all.deb
https://github.com/pymumu/smartdns/releases/download/Release47/smartdns.1.2025.09.18-2244.arm-debian-all.deb
https://github.com/pymumu/smartdns/releases/download/Release47/smartdns.1.2025.09.18-2244.x86-debian-all.deb
https://github.com/pymumu/smartdns/releases/download/Release47/smartdns.1.2025.09.18-2244.x86_64-debian-all.deb

下载

wget https://github.com/pymumu/smartdns/releases/download/Release47/smartdns.1.2025.09.18-2244.x86_64-debian-all.deb

备份配置文件 (如有)

cp /etc/smartdns/smartdns.conf /etc/smartdns/smartdns.conf.bak

安装

sudo dpkg -i smartdns.1.2025.09.18-2244.x86_64-debian-all.deb
sudo apt-get install -f 

检查UI插件是否存在,通过APT安装的软件包默认存在该目录

ls /usr/local/lib/smartdns/smartdns_ui.so

修改配置文件,增加或修改下面配置

编辑 nano /etc/smartdns/smartdns.conf 文件


# 数据目录
data-dir /var/lib/smartdns

# UI 插件
plugin /usr/local/lib/smartdns/smartdns_ui.so

# Web UI 根目录
smartdns-ui.www-root /usr/share/smartdns/wwwroot

# 绑定 HTTP 地址(IPv4 和 IPv6)➤ 删除所有 https:// 配置,避免证书生成失败!
smartdns-ui.ip http://0.0.0.0:6080
smartdns-ui.ip http://[::]:6080 # 

# 令牌过期时间(秒)
smartdns-ui.token-expire 600

# 查询日志最大保存时间(秒)
smartdns-ui.max-query-log-age 86400

# 启用终端功能
smartdns-ui.enable-terminal yes

# 启用 CORS(跨域)
smartdns-ui.enable-cors yes

# 登录用户名和密码
smartdns-ui.user admin 
smartdns-ui.password password 

启动服务

sudo systemctl daemon-reload
sudo systemctl enable smartdns
sudo systemctl start smartdns
sudo systemctl status smartdns

查看日志

sudo journalctl -u smartdns -n 30 --no-pager