From 78f4e34cf814c694d38a1e57758539468525787e Mon Sep 17 00:00:00 2001 From: Ekko Date: Sat, 2 Nov 2024 17:46:51 +0800 Subject: [PATCH] docs(dns): add docs for #649 (#687) --- docs/en/configuration/dns.md | 78 +++++++++++++++++++++++++++++++++++- docs/zh/configuration/dns.md | 78 +++++++++++++++++++++++++++++++++++- example.dae | 17 +++++++- 3 files changed, 168 insertions(+), 5 deletions(-) diff --git a/docs/en/configuration/dns.md b/docs/en/configuration/dns.md index 9f8351b..04b4587 100644 --- a/docs/en/configuration/dns.md +++ b/docs/en/configuration/dns.md @@ -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://:/ +http3://:/ + +default port: 443 +default path: /dns-query +``` + +DoH + +``` +https://:/ + +default port: 443 +default path: /dns-query +``` + +DoT + +``` +tls://: + +default port: 853 +``` + +DoQ + +``` +quic://: + +default port: 853 +``` + +UDP + +``` +udp://: + +default port: 53 +``` + +TCP + +``` +tcp://: + +default port: 53 +``` + +TCP and UDP + +``` +tcp+udp://: + +default port: 53 +``` + ## Examples ```shell @@ -18,8 +79,7 @@ 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. @@ -27,6 +87,20 @@ 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' } # 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 diff --git a/docs/zh/configuration/dns.md b/docs/zh/configuration/dns.md index db2d50e..352855d 100644 --- a/docs/zh/configuration/dns.md +++ b/docs/zh/configuration/dns.md @@ -2,6 +2,67 @@ dae 拦截目标端口为 53 的 UDP 流量并嗅探 DNS,以下为 DNS 配置的示例和模板。 +# Schema + +DoH3 + +``` +h3://:/ +http3://:/ + +默认端口: 443 +默认 path: /dns-query +``` + +DoH + +``` +https://:/ + +默认端口: 443 +默认 path: /dns-query +``` + +DoT + +``` +tls://: + +默认端口: 853 +``` + +DoQ + +``` +quic://: + +默认端口: 853 +``` + +UDP + +``` +udp://: + +默认端口: 53 +``` + +TCP + +``` +tcp://: + +默认端口: 53 +``` + +TCP and UDP + +``` +tcp+udp://: + +默认端口: 53 +``` + ## 示例 ```shell @@ -16,8 +77,7 @@ 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转发,按域名分流需要如此! @@ -25,6 +85,20 @@ 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 diff --git a/example.dae b/example.dae index 7115653..02dcffb 100644 --- a/example.dae +++ b/example.dae @@ -146,7 +146,8 @@ 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. @@ -154,6 +155,20 @@ 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' } routing { # According to the request of dns query, decide to use which DNS upstream.