Files
smartdns/docs/config/security.md
2023-11-02 22:27:40 +08:00

51 lines
899 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
hide:
- toc
---
# 安全相关
smartdns为DNS服务器默认绑定53端口这时smartdns需要root权限并且有可能导致外网也能进行数据查询。所以通过如下方式对smartdns进行安全加固
## 使用非root权限运行
通过user指定非root用户运行如使用nobody运行
```shell
user nobody
```
## 绑定特定的IP或网口
通过bind参数指定绑定的IP地址或网口
1. 绑定特定的IP
```shell
bind 192.168.1.1:53
```
1. 绑定特定的网口
```shell
bind [::]:53@eth0
```
## 对公网提供查询时使用TLS服务器
使用TLS服务器对外提供服务
```shell
bind-tls [::]:853@eth0
```
## 启用审计日志
smartdns可以通过如下配置启用审计日志记录DNS查询请求
```
audit-enable yes
audit-num 16
audit-size 16M
audit-file /var/log/smartdns/smartdns-audit.log
```