From 476d0bf24ff88d3bd230066104d49d4f2bb405c3 Mon Sep 17 00:00:00 2001 From: sbwml Date: Sat, 14 Oct 2023 03:16:28 +0800 Subject: [PATCH] luci-app-mosdns: use the `fallback` plugin to process apple domain names * Using `always_standby` can improve query efficiency --- .../root/usr/share/mosdns/default.yaml | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/luci-app-mosdns/root/usr/share/mosdns/default.yaml b/luci-app-mosdns/root/usr/share/mosdns/default.yaml index 5c736c5..cd855a3 100644 --- a/luci-app-mosdns/root/usr/share/mosdns/default.yaml +++ b/luci-app-mosdns/root/usr/share/mosdns/default.yaml @@ -114,6 +114,13 @@ plugins: upstreams: - addr: remote_dns + - tag: forward_remote_upstream + type: sequence + args: + - exec: prefer_ipv4 + - exec: ecs_remote + - exec: $forward_remote + - tag: modify_ttl type: sequence args: @@ -124,18 +131,6 @@ plugins: args: - exec: ttl 5-5 - - tag: local_sequence - type: sequence - args: - - exec: $forward_local - - - tag: remote_sequence - type: sequence - args: - - exec: prefer_ipv4 - - exec: ecs_remote - - exec: $forward_remote - - tag: has_resp_sequence type: sequence args: @@ -148,66 +143,65 @@ plugins: - matches: has_resp exec: accept - - tag: query_is_local_ip + - tag: query_is_non_local_ip type: sequence args: - - exec: $local_sequence + - exec: $forward_local - matches: "!resp_ip $geoip_cn" exec: drop_resp - - tag: query_is_remote - type: sequence - args: - - exec: $remote_sequence - - tag: fallback type: fallback args: - primary: query_is_local_ip - secondary: query_is_remote + primary: query_is_non_local_ip + secondary: forward_remote_upstream threshold: 500 always_standby: true + - tag: apple_domain_fallback + type: fallback + args: + primary: query_is_non_local_ip + secondary: forward_xinfeng_udp + threshold: 100 + always_standby: true + - tag: query_is_apple_domain type: sequence args: - matches: "!qname $geosite_apple" exec: return - - exec: $forward_local - - matches: "!resp_ip $geoip_cn" - exec: drop_resp - - matches: "!has_resp" - exec: $forward_xinfeng_udp + - exec: $apple_domain_fallback - tag: query_is_ddns_domain type: sequence args: - matches: qname $ddnslist - exec: $local_sequence + exec: $forward_local - tag: query_is_local_domain type: sequence args: - matches: qname $geosite_cn - exec: $local_sequence + exec: $forward_local - tag: query_is_no_local_domain type: sequence args: - matches: qname $geosite_no_cn - exec: $remote_sequence + exec: $forward_remote_upstream - tag: query_is_whitelist_domain type: sequence args: - matches: qname $whitelist - exec: $local_sequence + exec: $forward_local - tag: query_is_greylist_domain type: sequence args: - matches: qname $greylist - exec: $remote_sequence + exec: $forward_remote_upstream - tag: query_is_reject_domain type: sequence