mirror of
https://github.com/kenzok8/openwrt-packages.git
synced 2025-01-09 03:58:26 +08:00
update 2023-04-20 09:11:15
This commit is contained in:
parent
79c925c310
commit
2935ab2c18
@ -16,7 +16,7 @@ plugins:
|
||||
files:
|
||||
- "/var/mosdns/geosite_cn.txt"
|
||||
|
||||
# 国内ip
|
||||
# 国内 IP
|
||||
- tag: geoip_cn
|
||||
type: ip_set
|
||||
args:
|
||||
@ -30,62 +30,6 @@ plugins:
|
||||
files:
|
||||
- "/var/mosdns/geosite_geolocation-!cn.txt"
|
||||
|
||||
# 白名单 加入的域名始终允许使用 “本地 DNS” 进行解析
|
||||
- tag: whitelist
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- "/etc/mosdns/rule/whitelist.txt"
|
||||
|
||||
# 黑名单 加入的域名将屏蔽 DNS 解析
|
||||
- tag: blocklist
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- "/etc/mosdns/rule/blocklist.txt"
|
||||
|
||||
# 灰名单 加入的域名始终使用 “远程 DNS” 进行解析
|
||||
- tag: greylist
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- "/etc/mosdns/rule/greylist.txt"
|
||||
|
||||
# DDNS域名 加入的域名始终使用 “本地 DNS” 进行解析,并且修改 TTL 为 5 秒,解析结果不进行缓存
|
||||
- tag: ddnslist
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- "/etc/mosdns/rule/ddnslist.txt"
|
||||
|
||||
# 自定义 Hosts 重写
|
||||
- tag: hosts
|
||||
type: hosts
|
||||
args:
|
||||
files:
|
||||
- "/etc/mosdns/rule/hosts.txt"
|
||||
|
||||
# 重定向请求的域名
|
||||
- tag: redirect
|
||||
type: redirect
|
||||
args:
|
||||
files:
|
||||
- "/etc/mosdns/rule/redirect.txt"
|
||||
|
||||
# PTR 黑名单 加入的域名将阻止 PTR 请求
|
||||
- tag: local_ptr
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- "/etc/mosdns/rule/local-ptr.txt"
|
||||
|
||||
# 屏蔽失效/威胁 URL
|
||||
- tag: sp_low
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- "/usr/share/mosdns/sp_low.tdata"
|
||||
|
||||
# 缓存
|
||||
- tag: lazy_cache
|
||||
type: cache
|
||||
@ -112,18 +56,6 @@ plugins:
|
||||
- addr: tls://8.8.8.8
|
||||
enable_pipeline: false
|
||||
|
||||
# 修改ttl(默认0 不修改ttl)
|
||||
- tag: modify_ttl
|
||||
type: sequence
|
||||
args:
|
||||
- exec: ttl 0-0
|
||||
|
||||
# 修改 ddns 域名 ttl(默认 5秒)
|
||||
- tag: modify_ddns_ttl
|
||||
type: sequence
|
||||
args:
|
||||
- exec: ttl 5-5
|
||||
|
||||
# 国内解析
|
||||
- tag: local_sequence
|
||||
type: sequence
|
||||
@ -137,14 +69,10 @@ plugins:
|
||||
- exec: prefer_ipv4
|
||||
- exec: $forward_remote
|
||||
|
||||
# 有响应则修改 TTL 并终止返回
|
||||
# 有响应终止返回
|
||||
- tag: has_resp_sequence
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $ddnslist
|
||||
exec: $modify_ddns_ttl
|
||||
- matches: "!qname $ddnslist"
|
||||
exec: $modify_ttl
|
||||
- matches: has_resp
|
||||
exec: accept
|
||||
|
||||
@ -172,13 +100,6 @@ plugins:
|
||||
threshold: 500
|
||||
always_standby: true
|
||||
|
||||
# 查询 DDNS 域名
|
||||
- tag: query_is_ddns_domain
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $ddnslist
|
||||
exec: $local_sequence
|
||||
|
||||
# 查询国内域名
|
||||
- tag: query_is_local_domain
|
||||
type: sequence
|
||||
@ -193,60 +114,13 @@ plugins:
|
||||
- matches: qname $geosite_no_cn
|
||||
exec: $remote_sequence
|
||||
|
||||
# 查询白名单
|
||||
- tag: query_is_whitelist_domain
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $whitelist
|
||||
exec: $local_sequence
|
||||
|
||||
# 查询灰名单
|
||||
- tag: query_is_greylist_domain
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $greylist
|
||||
exec: $remote_sequence
|
||||
|
||||
# 拒绝名单
|
||||
- tag: query_is_reject_domain
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $blocklist
|
||||
exec: reject 3
|
||||
- matches: qname $sp_low
|
||||
exec: reject 3
|
||||
- matches:
|
||||
- qtype 12
|
||||
- qname $local_ptr
|
||||
exec: reject 3
|
||||
- matches: qtype 65
|
||||
exec: reject 3
|
||||
|
||||
# 主要的运行逻辑插件
|
||||
# sequence 插件中调用的插件 tag 必须在 sequence 前定义,
|
||||
# 否则 sequence 找不到对应插件。
|
||||
- tag: main_sequence
|
||||
type: sequence
|
||||
args:
|
||||
- exec: $hosts
|
||||
- exec: jump has_resp_sequence
|
||||
# 非 “拒绝名单” 或 “DDNS域名” 则启用缓存
|
||||
- matches:
|
||||
- "!qname $ddnslist"
|
||||
- "!qname $blocklist"
|
||||
- "!qname $sp_low"
|
||||
- "!qname $local_ptr"
|
||||
exec: $lazy_cache
|
||||
- exec: $redirect
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $query_is_ddns_domain
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $query_is_whitelist_domain
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $query_is_reject_domain
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $query_is_greylist_domain
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $lazy_cache
|
||||
- exec: $query_is_local_domain
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $query_is_no_local_domain
|
||||
|
Loading…
Reference in New Issue
Block a user