diff --git a/06.PVE制作DNS服务器.md b/06.PVE制作DNS服务器.md index 139954c..5ee33df 100644 --- a/06.PVE制作DNS服务器.md +++ b/06.PVE制作DNS服务器.md @@ -290,6 +290,13 @@ $ sudo crontab -e 30 9 * * * /usr/local/bin/smartdns-cnlist ``` +系统全局定时任务排期状态可使用以下命令进行查看。 + +```bash +## 查看系统定时任务 +$ sudo cronnext -acl +``` + ### 6.3. SmartDNS 主配置 `SmartDNS` 配置较为复杂,可按需制定各类 DNS 请求规则,建议先查阅官方提供的 [配置指导](https://pymumu.github.io/smartdns/config/basic-config/) 和 [配置选项](https://pymumu.github.io/smartdns/configuration/) 。 @@ -313,6 +320,13 @@ $ sudo mv /etc/smartdns/smartdns.conf /etc/smartdns/smartdns.conf.bak 创建 `SmartDNS` 主配置文件,执行以下命令。 +```bash +## 创建 SmartDNS 主配置文件 +$ sudo editor /etc/smartdns/smartdns.conf +``` + +在编辑器对话框中输入以下内容,并保存。 + **额外说明:** - `SmartDNS` 端口监听参数为 `6053@lo` ,WebUI 端口监听参数为 `5380` ,请根据实际情况进行调整 @@ -320,8 +334,6 @@ $ sudo mv /etc/smartdns/smartdns.conf /etc/smartdns/smartdns.conf.bak - WebUI 默认用户名密码为 `admin/password` ,若需公网访问建议将默认密码修改为强密码 ```bash -## 创建 SmartDNS 主配置文件 -$ sudo tee /etc/smartdns/smartdns.conf >/dev/null <<'EOF' # This configuration file is customized by fox, # Optimize SmartDNS parameters for local DNS server. # @@ -384,7 +396,7 @@ server-https https://dns.alidns.com/dns-query server-h3 h3://dns.alidns.com/dns-query -fallback server-https https://doh.360.cn/dns-query -fallback -EOF + ``` `SmartDNS` 主配置文件配置完成后,执行以下命令修正文件权限 @@ -405,6 +417,13 @@ $ sudo mkdir -p /etc/dnsmasq.d 创建 `Dnsmasq` 主配置文件,执行以下命令。 +```bash +## 创建 Dnsmasq 主配置文件 +$ sudo editor /etc/dnsmasq.d/10-server-dnsmasq.conf +``` + +在编辑器对话框中输入以下内容,并保存。 + **额外说明:** - 请根据系统内存使用情况,调整缓存参数 `cache-size` @@ -416,16 +435,11 @@ $ sudo mkdir -p /etc/dnsmasq.d - `Dnsmasq` 有且仅有 `SmartDNS` 作为上游 DNS 服务器 ```bash -## 创建 Dnsmasq 主配置文件 -$ sudo tee /etc/dnsmasq.d/10-server-dnsmasq.conf >/dev/null <<'EOF' # This configuration file is customized by fox, # Optimize dnsmasq parameters for local DNS server. # Main Config -conf-dir=/etc/dnsmasq.d/,*.conf -conf-file=/etc/dnsmasq.conf - log-facility=/var/log/dnsmasq.log log-async=20 @@ -434,37 +448,37 @@ max-cache-ttl=7200 fast-dns-retry=1800 interface=eth0 -rebind-domain-ok=/fox.internal/ bind-dynamic bogus-priv domain-needed no-hosts -no-negcache +no-ident no-resolv no-round-robin rebind-localhost-ok stop-dns-rebind +rebind-domain-ok=/fox.internal/ # DNS Filter -server=/alt/ -server=/bind/ -server=/example/ -server=/home.arpa/ -server=/internal/ -server=/invalid/ -server=/lan/ -server=/local/ -server=/localhost/ -server=/onion/ -server=/test/ +local=/alt/ +local=/bind/ +local=/example/ +local=/home.arpa/ +local=/internal/ +local=/invalid/ +local=/lan/ +local=/local/ +local=/localhost/ +local=/onion/ +local=/test/ # DNS Server server=/fox.internal/172.16.1.1 server=127.0.0.1#6053 -EOF + ``` ## 7.清理系统 diff --git a/07.PVE制作TS服务器.md b/07.PVE制作TS服务器.md index db5cd2d..65389d2 100644 --- a/07.PVE制作TS服务器.md +++ b/07.PVE制作TS服务器.md @@ -481,6 +481,13 @@ $ sudo mkdir -p /etc/dnsmasq.d 创建 `Dnsmasq` 主配置文件,执行以下命令。 +```bash +## 创建 Dnsmasq 主配置文件 +$ sudo editor /etc/dnsmasq.d/10-server-dnsmasq.conf +``` + +在编辑器对话框中输入以下内容,并保存。 + **额外说明:** - 请根据系统内存使用情况,调整缓存参数 `cache-size` @@ -495,16 +502,11 @@ $ sudo mkdir -p /etc/dnsmasq.d - `server` 参数中的其他 DNS 服务器供 TS 服务器自身及其下游设备使用 ```bash -## 创建 Dnsmasq 主配置文件 -$ sudo tee /etc/dnsmasq.d/10-server-dnsmasq.conf >/dev/null <<'EOF' # This configuration file is customized by fox, # Optimize dnsmasq parameters for local TS server. # Main Config -conf-dir=/etc/dnsmasq.d/,*.conf -conf-file=/etc/dnsmasq.conf - log-facility=/var/log/dnsmasq.log log-async=20 @@ -513,38 +515,38 @@ max-cache-ttl=7200 fast-dns-retry=1800 interface=eth0,tailscale0 -rebind-domain-ok=/fox.internal/ bind-dynamic bogus-priv domain-needed no-hosts -no-negcache +no-ident no-resolv no-round-robin rebind-localhost-ok stop-dns-rebind +rebind-domain-ok=/fox.internal/ # DNS Filter -server=/alt/ -server=/bind/ -server=/example/ -server=/home.arpa/ -server=/internal/ -server=/invalid/ -server=/lan/ -server=/local/ -server=/localhost/ -server=/onion/ -server=/test/ +local=/alt/ +local=/bind/ +local=/example/ +local=/home.arpa/ +local=/internal/ +local=/invalid/ +local=/lan/ +local=/local/ +local=/localhost/ +local=/onion/ +local=/test/ # DNS Server server=/ts.net/100.100.100.100 server=/fox.internal/172.16.1.1 server=172.16.1.1 -EOF + ``` 配置完成后,需重启 `dnsmasq.service` 服务。 diff --git a/src/debian/debian_dns_dnsmasq.conf b/src/debian/debian_dns_dnsmasq.conf index 83679fc..d5dc6f6 100644 --- a/src/debian/debian_dns_dnsmasq.conf +++ b/src/debian/debian_dns_dnsmasq.conf @@ -3,9 +3,6 @@ # Main Config -conf-dir=/etc/dnsmasq.d/,*.conf -conf-file=/etc/dnsmasq.conf - log-facility=/var/log/dnsmasq.log log-async=20 @@ -14,31 +11,31 @@ max-cache-ttl=7200 fast-dns-retry=1800 interface=eth0 -rebind-domain-ok=/fox.internal/ bind-dynamic bogus-priv domain-needed no-hosts -no-negcache +no-ident no-resolv no-round-robin rebind-localhost-ok stop-dns-rebind +rebind-domain-ok=/fox.internal/ # DNS Filter -server=/alt/ -server=/bind/ -server=/example/ -server=/home.arpa/ -server=/internal/ -server=/invalid/ -server=/lan/ -server=/local/ -server=/localhost/ -server=/onion/ -server=/test/ +local=/alt/ +local=/bind/ +local=/example/ +local=/home.arpa/ +local=/internal/ +local=/invalid/ +local=/lan/ +local=/local/ +local=/localhost/ +local=/onion/ +local=/test/ # DNS Server diff --git a/src/debian/debian_ts_dnsmasq.conf b/src/debian/debian_ts_dnsmasq.conf index aee4dfe..9fa1bee 100644 --- a/src/debian/debian_ts_dnsmasq.conf +++ b/src/debian/debian_ts_dnsmasq.conf @@ -3,9 +3,6 @@ # Main Config -conf-dir=/etc/dnsmasq.d/,*.conf -conf-file=/etc/dnsmasq.conf - log-facility=/var/log/dnsmasq.log log-async=20 @@ -14,31 +11,31 @@ max-cache-ttl=7200 fast-dns-retry=1800 interface=eth0,tailscale0 -rebind-domain-ok=/fox.internal/ bind-dynamic bogus-priv domain-needed no-hosts -no-negcache +no-ident no-resolv no-round-robin rebind-localhost-ok stop-dns-rebind +rebind-domain-ok=/fox.internal/ # DNS Filter -server=/alt/ -server=/bind/ -server=/example/ -server=/home.arpa/ -server=/internal/ -server=/invalid/ -server=/lan/ -server=/local/ -server=/localhost/ -server=/onion/ -server=/test/ +local=/alt/ +local=/bind/ +local=/example/ +local=/home.arpa/ +local=/internal/ +local=/invalid/ +local=/lan/ +local=/local/ +local=/localhost/ +local=/onion/ +local=/test/ # DNS Server