mosdns/config.d/rules/example-anti-pollution.yaml
dengxiongjian 0413ee5d44
Some checks failed
Test mosdns / build (push) Has been cancelled
二次开发
2025-10-16 21:07:48 +08:00

37 lines
937 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ============================================
# 智能防污染规则示例
# 适用于可能被污染的域名
# ============================================
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