37 lines
937 B
YAML
37 lines
937 B
YAML
# ============================================
|
||
# 智能防污染规则示例
|
||
# 适用于可能被污染的域名
|
||
# ============================================
|
||
|
||
plugins:
|
||
# 1. 域名集合定义
|
||
- tag: domains_example
|
||
type: domain_set
|
||
args:
|
||
files:
|
||
- "/usr/local/yltx-dns/domains/example.txt"
|
||
|
||
# 2. 解析策略序列(智能防污染)
|
||
- tag: rule_example
|
||
type: sequence
|
||
args:
|
||
# 匹配域名
|
||
- matches: qname $domains_example
|
||
exec: prefer_ipv4
|
||
|
||
# 使用智能防污染策略
|
||
# 逻辑:先国内 DNS,如果返回国外 IP 则用国外 DNS 重查
|
||
- matches: qname $domains_example
|
||
exec: $smart_anti_pollution
|
||
|
||
# 返回结果
|
||
- matches:
|
||
- qname $domains_example
|
||
- has_resp
|
||
exec: accept
|
||
|
||
# 记录日志
|
||
- matches: qname $domains_example
|
||
exec: query_summary example_resolved
|
||
|