更新文档

This commit is contained in:
CallMeR
2024-01-01 13:36:04 +08:00
parent 0a9a2ee8fe
commit 52f3be600b
+93
View File
@@ -412,6 +412,13 @@ $ sudo nvim /etc/nftables.conf
由于防火墙配置文件很长,因此请查阅文件 [debian_ts_nftables.conf](./src/debian/debian_ts_nftables.conf) 进行复制。 由于防火墙配置文件很长,因此请查阅文件 [debian_ts_nftables.conf](./src/debian/debian_ts_nftables.conf) 进行复制。
配置完成后,需重启 `nftables.service` 服务。
```bash
## 重启 nftables.service
$ sudo systemctl restart nftables.service
```
### 1.9.调整系统端口 ### 1.9.调整系统端口
为了正常使用 `53` 端口,需要对 `systemd-resolved.service` 进行配置,执行以下命令。 为了正常使用 `53` 端口,需要对 `systemd-resolved.service` 进行配置,执行以下命令。
@@ -449,3 +456,89 @@ $ sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
## 重启 systemd-resolved.service ## 重启 systemd-resolved.service
$ sudo systemctl restart systemd-resolved.service $ sudo systemctl restart systemd-resolved.service
``` ```
### 1.10.配置 Dnsmasq
`Dnsmasq` 的主配置文件一般位于 `/etc` 目录下,修改配置文件之前,使用以下命令将其备份。
```bash
## 备份 Dnsmasq 主配置文件
$ sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
```
使用 `neovim` 编辑器创建 `Dnsmasq` 主配置文件,执行以下命令。
```bash
## 创建 Dnsmasq 主配置文件
$ sudo nvim /etc/dnsmasq.conf
```
在编辑器对话框中输入以下内容,并保存。
**额外说明:**
- 请根据系统内存使用情况,调整缓存参数 `cache-size`
- 演示中内网域名为 `fox.home.arpa` ,请根据实际情况进行调整。
- `Dnsmasq` 上游 DNS 服务器分为三类,请根据实际情况进行调整。
- `server=/fox.home.arpa/172.16.1.1` 为内网域名解析 DNS 服务器,通常为主路由地址
- `server=/ts.net/100.100.100.100` 为 TS 服务 MagicDNS 专用地址
- 其他 `server` 参数中的 DNS 服务器,为 TS 服务器自身及下游设备提供 DNS 解析服务
```bash
# 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
cache-size=1024
edns-packet-max=1232
rebind-domain-ok=/fox.home.arpa/
bind-dynamic
bogus-priv
domain-needed
localise-queries
local-service
no-hosts
no-negcache
no-round-robin
rebind-localhost-ok
stop-dns-rebind
# DNS Filter
server=/alt/
server=/home.arpa/
server=/ipv4only.arpa/
server=/resolver.arpa/
server=/example/
server=/bind/
server=/invalid/
server=/local/
server=/localhost/
server=/onion/
server=/test/
# DNS Server
server=/fox.home.arpa/172.16.1.1
server=/ts.net/100.100.100.100
server=172.16.1.1
server=fdac::1
```
配置完成后,需重启 `dnsmasq.service` 服务。
```bash
## 重启 dnsmasq.service
$ sudo systemctl restart dnsmasq.service
```