Skip to content

Commit

Permalink
docs(dns): add docs for #649 (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
EkkoG authored Nov 2, 2024
1 parent bfc17c3 commit 78f4e34
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 5 deletions.
78 changes: 76 additions & 2 deletions docs/en/configuration/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

# 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

```shell
Expand All @@ -18,15 +79,28 @@ dns {
}

upstream {
# Value can be scheme://host:port.
# Scheme list: tcp, udp, tcp+udp. Ongoing: https, tls, quic.
# Scheme list: tcp, udp, tcp+udp, https, tls, http3, h3, quic, details see above Schema.
# 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).
# Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing.
# If dial_mode is "ip", the upstream DNS answer SHOULD NOT be polluted, so domestic public DNS is not recommended.

alidns: 'udp://dns.alidns.com: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'.
# See https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/routing.md
Expand Down
78 changes: 76 additions & 2 deletions docs/zh/configuration/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,67 @@

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
Expand All @@ -16,15 +77,28 @@ dns {
}

upstream {
# 格式为“协议://主机:端口”
# 支持协议:tcp, udp, tcp+udp(对于https, tls, quic的支持孵化中)。
# 支持协议:tcp, udp, tcp+udp, https, tls, http3, h3, quic, 详情见上面的 Schema。
# 若主机为域名且具有 A 和 AAAA 记录,dae 自动选择 IPv4 或 IPv6 进行连接,
# 是否走代理取决于全局的 routing(不是下面 dns 配置部分的 routing),节点选择取决于 group 的策略。
# 请确保DNS流量经过dae且由dae转发,按域名分流需要如此!
# 若 dial_mode 设为 'ip',请确保上游 DNS 无污染,不推荐使用国内公共 DNS。

alidns: 'udp://dns.alidns.com: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' 类似。
# 参考 https://github.com/daeuniverse/dae/blob/main/docs/zh/configuration/routing.md
Expand Down
17 changes: 16 additions & 1 deletion example.dae
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,29 @@ dns {
#}

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
# 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.
# If dial_mode is "ip", the upstream DNS answer SHOULD NOT be polluted, so domestic public DNS is not recommended.

alidns: 'udp://dns.alidns.com: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 {
# According to the request of dns query, decide to use which DNS upstream.
Expand Down

0 comments on commit 78f4e34

Please sign in to comment.