From dfff109e986643a6f202b7de91848c61882786a4 Mon Sep 17 00:00:00 2001 From: sbwml <984419930@qq.com> Date: Sat, 25 Mar 2023 02:06:00 +0800 Subject: [PATCH] luci-app-mosdns: update config files --- .../root/etc/mosdns/config_custom.yaml | 16 ++++++++-------- .../root/usr/share/mosdns/default.yaml | 8 +++----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/luci-app-mosdns/root/etc/mosdns/config_custom.yaml b/luci-app-mosdns/root/etc/mosdns/config_custom.yaml index a761dea..ec9f546 100644 --- a/luci-app-mosdns/root/etc/mosdns/config_custom.yaml +++ b/luci-app-mosdns/root/etc/mosdns/config_custom.yaml @@ -77,8 +77,10 @@ plugins: - tag: cache type: cache args: - size: 200000 - lazy_cache_ttl: 259200 + size: 20000 + lazy_cache_ttl: 86400 + dump_file: "/etc/mosdns/cache.dump" + dump_interval: 600 # 转发至本地服务器 - tag: forward_local @@ -127,21 +129,19 @@ plugins: exec: accept # fallback 用本地服务器 sequence - # 返回不包含本地 ip 则 reject + # 返回非国内 ip 则 drop_resp - tag: query_is_local_ip type: sequence args: - exec: $local_sequence - - matches: resp_ip $geoip_cn - exec: accept - - exec: reject + - matches: "!resp_ip $geoip_cn" + exec: drop_resp # fallback 用远程服务器 sequence - tag: query_is_remote type: sequence args: - exec: $remote_sequence - - exec: accept # fallback 用远程服务器 sequence - tag: fallback @@ -150,7 +150,7 @@ plugins: primary: query_is_local_ip secondary: query_is_remote threshold: 500 - always_standby: false + always_standby: true # 查询国内域名 - tag: query_is_local_domain diff --git a/luci-app-mosdns/root/usr/share/mosdns/default.yaml b/luci-app-mosdns/root/usr/share/mosdns/default.yaml index 93e3259..59a479f 100644 --- a/luci-app-mosdns/root/usr/share/mosdns/default.yaml +++ b/luci-app-mosdns/root/usr/share/mosdns/default.yaml @@ -116,15 +116,13 @@ plugins: type: sequence args: - exec: $local_sequence - - matches: resp_ip $geoip_cn - exec: accept - - exec: reject + - matches: "!resp_ip $geoip_cn" + exec: drop_resp - tag: query_is_remote type: sequence args: - exec: $remote_sequence - - exec: accept - tag: fallback type: fallback @@ -132,7 +130,7 @@ plugins: primary: query_is_local_ip secondary: query_is_remote threshold: 500 - always_standby: false + always_standby: true - tag: query_is_local_domain type: sequence