config: add basic and server configuration guide.
This commit is contained in:
28
docs/config/basic-config.md
Normal file
28
docs/config/basic-config.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# 基础配置
|
||||
|
||||
smartdns配置选项,功能比较丰富,但作为最基本的DNS服务,只需要配置服务端口号,和上游服务器即可,其他参数默认情况下,对于家庭本地网络已经是最佳配置。
|
||||
|
||||
## 配置样例
|
||||
|
||||
在smartdns.conf配置文件中,包含配置如下即可提供服务并对DNS查询加速:
|
||||
|
||||
```shell
|
||||
# 监听53端口
|
||||
bind [::]:53
|
||||
# 配置上游服务器
|
||||
server 8.8.8.8
|
||||
server 114.114.114.114
|
||||
server 202.96.128.166:53
|
||||
server-tls 1.1.1.1
|
||||
```
|
||||
|
||||
选项中:
|
||||
|
||||
* bind表示开启服务端,并监听对应的端口,`:53`表示绑定IPV4的53端口,`[::]:53`表示绑定IPV6的53端口,后者在大部分系统中,同时也绑定了IPV4端口。
|
||||
* server表示上游服务器IP地址,端口可以省略。如需要安全访问上游,可以使用server-tls, server-https。也可以使用URI方式,如server tls://1.1.1.1:853
|
||||
* server不指定的情况下,将会自动读取`/etc/resolv.conf`文件中的系统DNS地址。
|
||||
@@ -3,7 +3,7 @@ hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# 黑名单分流请求
|
||||
# 白名单分流请求
|
||||
|
||||
## 分流流程
|
||||
|
||||
|
||||
75
docs/config/server-config.md
Normal file
75
docs/config/server-config.md
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# 服务端配置
|
||||
|
||||
smartdns目前提供了UDP, TCP, DOT三种服务端模式。
|
||||
|
||||
## UDP服务端
|
||||
|
||||
1. 通过`bind`参数配置,配置例子如下:
|
||||
|
||||
```shell
|
||||
bind 0.0.0.0:53@eth0
|
||||
bind [::]:53@eth0
|
||||
bind :53@eth0
|
||||
```
|
||||
|
||||
选项中:
|
||||
|
||||
* @eth0,表示仅在对应的网口上提供服务。
|
||||
* [::]:53, 表示监听IPV6和IPV4地址。
|
||||
* :53,表示监听IPV4地址
|
||||
|
||||
## TCP服务端
|
||||
|
||||
1. 通过`bind-tcp`参数配置,配置例子如下:
|
||||
|
||||
```shell
|
||||
bind-tcp 0.0.0.0:53@eth0
|
||||
bind-tcp [::]:53@eth0
|
||||
bind-tcp :53@eth0
|
||||
```
|
||||
|
||||
1. 可选,参数tcp-idle-time控制TCP空闲断链时间
|
||||
|
||||
```shell
|
||||
tcp-idle-time 120
|
||||
```
|
||||
|
||||
## DOT服务端
|
||||
|
||||
1. 通过`bind-tcp`参数配置,配置例子如下:
|
||||
|
||||
```shell
|
||||
bind-tcp 0.0.0.0:53@eth0
|
||||
bind-tcp [::]:53@eth0
|
||||
bind-tcp :53@eth0
|
||||
|
||||
```
|
||||
|
||||
1. 设置证书和密钥文件
|
||||
|
||||
```shell
|
||||
bind-cert-file smartdns-cert.pem
|
||||
bind-cert-key-file smartdns-key.pem
|
||||
bind-cert-key-pass pass
|
||||
```
|
||||
|
||||
选项中:
|
||||
|
||||
* bind-cert-file: 表示证书文件路径。
|
||||
* bind-cert-key-file:表示证书密钥文件路径。
|
||||
* bind-cert-key-pass: 表示证书密钥文件密码,可选。
|
||||
|
||||
注意:
|
||||
|
||||
上述三个参数如果不指定的情况下,smartdns将会自动在/etc/smartdns目录自动生成自签名证书`smartdns-cert.pem`和`smartdns-key.pem` key文件,CN为smartdns。
|
||||
|
||||
1. 可选,参数tcp-idle-time控制TCP空闲断链时间
|
||||
|
||||
```shell
|
||||
tcp-idle-time 120
|
||||
```
|
||||
@@ -40,8 +40,8 @@ entware|ipkg update<br />ipkg install smartdns|软件源路径:<https://bin.en
|
||||
| OpenWrt(ARM) | smartdns.1.yyyy.MM.dd-REL.arm-openwrt-all.ipk | ARM 小端架构的 OpenWrt 系统 |
|
||||
| OpenWrt LuCI | luci-app-smartdns.1.yyyy.MM.dd-REL.all.ipk | OpenWrt 管理界面 |
|
||||
| OpenWrt LuCI | luci-app-smartdns.1.yyyy.MM.dd-REL.all-luci-compat-all.ipk | OpenWrt 管理界面、OpenWrt 18.xx 及之前版本 |
|
||||
| Windows | smartdns-rs https://github.com/mokeyish/smartdns-rs | Rust版本SmartDNS | [Rust版本SmartDNS](https://github.com/mokeyish/smartdns-rs) |
|
||||
| MacOS | smartdns-rs https://github.com/mokeyish/smartdns-rs | Rust版本SmartDNS |
|
||||
| Windows | smartdns-rs [https://github.com/mokeyish/smartdns-rs](https://github.com/mokeyish/smartdns-rs) | Rust版本SmartDNS | [Rust版本SmartDNS](https://github.com/mokeyish/smartdns-rs) |
|
||||
| MacOS | smartdns-rs [https://github.com/mokeyish/smartdns-rs](https://github.com/mokeyish/smartdns-rs) | Rust版本SmartDNS |
|
||||
|
||||
**[前往 Release 页面下载](https://github.com/pymumu/smartdns/releases)。**
|
||||
|
||||
|
||||
16
mkdocs.yml
16
mkdocs.yml
@@ -77,21 +77,23 @@ nav:
|
||||
- EntWare: 'install/entware.md'
|
||||
- WSL: 'install/wsl.md'
|
||||
- 配置指导:
|
||||
- 基本配置: 'config/basic-config.md'
|
||||
- 服务端配置: 'config/server-config.md'
|
||||
- 缓存设置: 'config/cache.md'
|
||||
- 屏蔽广告: 'config/ad-block.md'
|
||||
- 双栈优选: 'config/dualstack.md'
|
||||
- 禁用IPV6: 'config/block-ipv6.md'
|
||||
- DNS分流: 'config/domain-forwarding.md'
|
||||
- 工作模式: 'config/work-mode.md'
|
||||
- 安全相关: 'config/security.md'
|
||||
- 解析本地主机名: 'config/resolv-dnsmasq-lease.md'
|
||||
- Bootstrap DNS: 'config/bootstrap-dns.md'
|
||||
- cname别名查询: 'config/cname.md'
|
||||
- 域名集合: 'config/domain-set.md'
|
||||
- IPSet和NFTSet: 'config/ipset-nftset.md'
|
||||
- 通过代理查询: 'config/proxy.md'
|
||||
- 解析本地主机名: 'config/resolv-dnsmasq-lease.md'
|
||||
- 缓存设置: 'config/cache.md'
|
||||
- 双栈优选: 'config/dualstack.md'
|
||||
- 禁用IPV6: 'config/block-ipv6.md'
|
||||
- DNS64: 'config/dns64.md'
|
||||
- cname别名查询: 'config/cname.md'
|
||||
- 安全相关: 'config/security.md'
|
||||
- 黑名单分流请求: 'config/forwarding-with-ipset.md'
|
||||
- 白名单分流请求: 'config/forwarding-with-ipset.md'
|
||||
- 配置选项: 'configuration.md'
|
||||
- 编译: 'compile.md'
|
||||
- 常见问题: 'faq.md'
|
||||
|
||||
Reference in New Issue
Block a user