docs(dns): add docs for #649 (#687)

This commit is contained in:
Ekko 2024-11-02 17:46:51 +08:00 committed by GitHub
parent bfc17c3e2d
commit 78f4e34cf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 168 additions and 5 deletions

View File

@ -2,6 +2,67 @@
dae will intercept all UDP traffic to port 53 and sniff DNS. Here gives some examples and templates for DNS configuration. dae will intercept all UDP traffic to port 53 and sniff DNS. Here gives some examples and templates for DNS configuration.
# Schema
DoH3
```
h3://<host>:<port>/<path>
http3://<host>:<port>/<path>
default port: 443
default path: /dns-query
```
DoH
```
https://<host>:<port>/<path>
default port: 443
default path: /dns-query
```
DoT
```
tls://<host>:<port>
default port: 853
```
DoQ
```
quic://<host>:<port>
default port: 853
```
UDP
```
udp://<host>:<port>
default port: 53
```
TCP
```
tcp://<host>:<port>
default port: 53
```
TCP and UDP
```
tcp+udp://<host>:<port>
default port: 53
```
## Examples ## Examples
```shell ```shell
@ -18,8 +79,7 @@ dns {
} }
upstream { upstream {
# Value can be scheme://host:port. # Scheme list: tcp, udp, tcp+udp, https, tls, http3, h3, quic, details see above Schema.
# Scheme list: tcp, udp, tcp+udp. Ongoing: https, tls, quic.
# If host is a domain and has both IPv4 and IPv6 record, dae will automatically choose # If host is a domain and has both IPv4 and IPv6 record, dae will automatically choose
# IPv4 or IPv6 to use according to group policy (such as min latency policy). # IPv4 or IPv6 to use according to group policy (such as min latency policy).
# Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing. # Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing.
@ -27,6 +87,20 @@ dns {
alidns: 'udp://dns.alidns.com:53' alidns: 'udp://dns.alidns.com:53'
googledns: 'tcp+udp://dns.google:53' googledns: 'tcp+udp://dns.google:53'
# alih3: 'h3://dns.alidns.com:443'
# alih3_path: 'h3://dns.alidns.com:443/dns-query'
# alihttp3: 'http3://dns.alidns.com:443'
# alihttp3_path: 'http3://dns.alidns.com:443/dns-query'
# ali_quic: 'quic://dns.alidns.com:853'
# h3_cusotm_path: 'h3://dns.example.com:443/custom-path'
# http3_cusotm_path: 'http3://dns.example.com:443/custom-path'
# ali_doh: 'https://dns.alidns.com:443'
# ali_dot: 'tls://dns.alidns.com:853'
# doh_cusotm_path: 'https://dns.example.com:443/custom-path'
} }
# The routing format of 'request' and 'response' is similar with section 'routing'. # The routing format of 'request' and 'response' is similar with section 'routing'.
# See https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/routing.md # See https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/routing.md

View File

@ -2,6 +2,67 @@
dae 拦截目标端口为 53 的 UDP 流量并嗅探 DNS以下为 DNS 配置的示例和模板。 dae 拦截目标端口为 53 的 UDP 流量并嗅探 DNS以下为 DNS 配置的示例和模板。
# Schema
DoH3
```
h3://<host>:<port>/<path>
http3://<host>:<port>/<path>
默认端口: 443
默认 path: /dns-query
```
DoH
```
https://<host>:<port>/<path>
默认端口: 443
默认 path: /dns-query
```
DoT
```
tls://<host>:<port>
默认端口: 853
```
DoQ
```
quic://<host>:<port>
默认端口: 853
```
UDP
```
udp://<host>:<port>
默认端口: 53
```
TCP
```
tcp://<host>:<port>
默认端口: 53
```
TCP and UDP
```
tcp+udp://<host>:<port>
默认端口: 53
```
## 示例 ## 示例
```shell ```shell
@ -16,8 +77,7 @@ dns {
} }
upstream { upstream {
# 格式为“协议://主机:端口” # 支持协议tcp, udp, tcp+udp, https, tls, http3, h3, quic, 详情见上面的 Schema。
# 支持协议tcp, udp, tcp+udp对于https, tls, quic的支持孵化中
# 若主机为域名且具有 A 和 AAAA 记录dae 自动选择 IPv4 或 IPv6 进行连接, # 若主机为域名且具有 A 和 AAAA 记录dae 自动选择 IPv4 或 IPv6 进行连接,
# 是否走代理取决于全局的 routing不是下面 dns 配置部分的 routing节点选择取决于 group 的策略。 # 是否走代理取决于全局的 routing不是下面 dns 配置部分的 routing节点选择取决于 group 的策略。
# 请确保DNS流量经过dae且由dae转发按域名分流需要如此 # 请确保DNS流量经过dae且由dae转发按域名分流需要如此
@ -25,6 +85,20 @@ dns {
alidns: 'udp://dns.alidns.com:53' alidns: 'udp://dns.alidns.com:53'
googledns: 'tcp+udp://dns.google:53' googledns: 'tcp+udp://dns.google:53'
# alih3: 'h3://dns.alidns.com:443'
# alih3_path: 'h3://dns.alidns.com:443/dns-query'
# alihttp3: 'http3://dns.alidns.com:443'
# alihttp3_path: 'http3://dns.alidns.com:443/dns-query'
# ali_quic: 'quic://dns.alidns.com:853'
# h3_cusotm_path: 'h3://dns.example.com:443/custom-path'
# http3_cusotm_path: 'http3://dns.example.com:443/custom-path'
# ali_doh: 'https://dns.alidns.com:443'
# ali_dot: 'tls://dns.alidns.com:853'
# doh_cusotm_path: 'https://dns.example.com:443/custom-path'
} }
# 'request' 和 'response' 的 routing 格式和全局的 'routing' 类似。 # 'request' 和 'response' 的 routing 格式和全局的 'routing' 类似。
# 参考 https://github.com/daeuniverse/dae/blob/main/docs/zh/configuration/routing.md # 参考 https://github.com/daeuniverse/dae/blob/main/docs/zh/configuration/routing.md

View File

@ -146,7 +146,8 @@ dns {
#} #}
upstream { upstream {
# Value can be scheme://host:port, where the scheme can be tcp/udp/tcp+udp. # Value can be scheme://host:port, where the scheme can be tcp/udp/tcp+udp/h3/http3/quic/https/tls.
# If the protocol is h3/http3/https, it supports setting a custom path, that is, the format can be "protocol://host:port/custom path".
# If host is a domain and has both IPv4 and IPv6 record, dae will automatically choose # If host is a domain and has both IPv4 and IPv6 record, dae will automatically choose
# IPv4 or IPv6 to use according to group policy (such as min latency policy). # IPv4 or IPv6 to use according to group policy (such as min latency policy).
# Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing. # Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing.
@ -154,6 +155,20 @@ dns {
alidns: 'udp://dns.alidns.com:53' alidns: 'udp://dns.alidns.com:53'
googledns: 'tcp+udp://dns.google:53' googledns: 'tcp+udp://dns.google:53'
# alih3: 'h3://dns.alidns.com:443'
# alih3_path: 'h3://dns.alidns.com:443/dns-query'
# alihttp3: 'http3://dns.alidns.com:443'
# alihttp3_path: 'http3://dns.alidns.com:443/dns-query'
# ali_quic: 'quic://dns.alidns.com:853'
# h3_cusotm_path: 'h3://dns.example.com:443/custom-path'
# http3_cusotm_path: 'http3://dns.example.com:443/custom-path'
# ali_doh: 'https://dns.alidns.com:443'
# ali_dot: 'tls://dns.alidns.com:853'
# doh_cusotm_path: 'https://dns.example.com:443/custom-path'
} }
routing { routing {
# According to the request of dns query, decide to use which DNS upstream. # According to the request of dns query, decide to use which DNS upstream.