修复 tee 命令兼容性问题,并优化 Dnsmasq 配置

This commit is contained in:
CallMeR
2026-08-14 14:43:08 +08:00
parent fcc5c2b019
commit e6aab0f222
4 changed files with 83 additions and 73 deletions
+21 -19
View File
@@ -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` 服务。