diff options
author | Midori | 2021-08-03 11:36:35 +0900 |
---|---|---|
committer | Midori | 2021-08-03 11:36:35 +0900 |
commit | a487b0a3292de077096ccaf6f8c32215d2038299 (patch) | |
tree | be391387b34d0bd4c711372c9eff2063ebefe217 | |
parent | 5194ef400a5adeaad9e0dc9c83fb799e557c531f (diff) | |
download | aur-a487b0a3292de077096ccaf6f8c32215d2038299.tar.gz |
update config.yaml
-rw-r--r-- | .SRCINFO | 3 | ||||
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | config.yaml | 48 |
3 files changed, 23 insertions, 30 deletions
@@ -1,7 +1,7 @@ pkgbase = mosdns-bin pkgdesc = Plug-in configured DNS forwarder/server pkgver = 1.8.6 - pkgrel = 1 + pkgrel = 2 url = https://github.com/IrineSistiana/mosdns/ arch = x86_64 license = GPL3 @@ -16,4 +16,3 @@ pkgbase = mosdns-bin sha256sums = 006d0567250d22dc702939a253bb043960d3a8f6dcc661c7901f07dda2a962b8 pkgname = mosdns-bin - @@ -2,7 +2,7 @@ _pkgname=mosdns pkgname=${_pkgname}-bin pkgver=1.8.6 -pkgrel=1 +pkgrel=2 pkgdesc="Plug-in configured DNS forwarder/server" arch=('x86_64') url="https://github.com/IrineSistiana/mosdns/" diff --git a/config.yaml b/config.yaml index 0a1d96614cdd..3cea2a5cc004 100644 --- a/config.yaml +++ b/config.yaml @@ -3,11 +3,15 @@ log: file: "" plugin: - - tag: main_server # 启动服务器 + ################# 服务插件 ################ + + # 启动服务器的插件 + - tag: main_server type: server args: - entry: main_sequence - max_concurrent_queries: 0 + entry: + - _default_cache # 缓存 + - main_sequence # 分流逻辑 server: - protocol: udp addr: 127.0.0.1:53 @@ -20,15 +24,15 @@ plugin: ################# 可执行插件 ################ + # 包含分流的逻辑的插件 - tag: main_sequence type: sequence args: exec: - - _default_cache # 缓存 - if: - query_is_ad_domain # 已知的广告域名 exec: - - _block_with_nxdomain # 屏蔽 + - _block_with_nxdomain # 用 NXDOMAIN 屏蔽 - _end - if: @@ -44,41 +48,31 @@ plugin: - forward_remote # 用远程服务器 - _end - # 剩下的域名用 IP 分流。 - # 有两种方案:"顺序分流"或"并发分流"。 - # 下面的是"顺序分流"的配置. - + # 剩下的未知域名用 IP 分流。以下是"顺序 IP 分流"方案。先转发至本地服务器,然后 + # 判断应答 IP 再决定是否转发至远程服务器。没有竞争,很稳定,不易出错。 + # <高级> 如果想用"并发 IP 分流"方案,从下文的 <并发 IP 分流示例> 里选择一个方案, + # 然后将下面几行替换掉。复制时注意缩进。 + # 并发分流会同时请求本地和远程服务器,延时稍低些,但存在竞争,可能出现非期望的分流结果。 - forward_local # 先请求转发至本地服务器 - if: - - response_has_local_ip # 如果应答包含本地 IP + - response_has_local_ip # 如果(本地)应答包含本地 IP + exec: - _end # 就直接采用结果 - - forward_remote # 否则用远程服务器的结果 - - # 如果想用类似 ChinaDNS 的"并发分流"逻辑。将上面的配置注释掉,然后用下面的配置。 - # 注意: 如果上游支持连接复用,不要用并发分流。因为服务器延时不可预测,会有问题。 - - # - parallel: - # - - forward_local # 并发请求本地和远程服务器 - # - if: - # - "!response_has_local_ip" # 如果本地服务器返回的非本地 IP - # exec: - # - _drop_response # 应答会被丢弃 - # - - forward_remote + - forward_remote # 否则去请求远程服务器的结果 - - tag: forward_local # 转发至本地服务器的插件 + # 转发请求至本地服务器的插件 + - tag: forward_local type: forward args: upstream: - addr: https://223.5.5.5/dns-query - - tag: forward_remote # 转发至远程服务器的插件 + # 转发请求至远程服务器的插件 + - tag: forward_remote type: forward args: upstream: - - addr: https://1.0.0.1/dns-query - addr: https://1.1.1.1/dns-query - - addr: https://2606:4700:4700::1111/dns-query - - addr: https://2606:4700:4700::1001/dns-query ################ 匹配器插件 ################# |