# YLTX-DNS 智能防污染系统主配置文件 # 此配置文件展示了如何使用智能防污染功能 log: level: info api: http: "0.0.0.0:5541" web: http: "0.0.0.0:5555" # ==================== 基础DNS上游定义 ==================== plugins: # 国内DNS(并行查询,提升速度) - tag: china-dns type: forward args: concurrent: 3 # 并发查询3个上游 upstreams: - addr: "223.5.5.5" # 阿里DNS - addr: "119.29.29.29" # 腾讯DNS - addr: "114.114.114.114" # 114DNS # 国际DNS(使用DoH加密,提升隐私) - tag: overseas-dns type: forward args: upstreams: - addr: "https://1.1.1.1/dns-query" # Cloudflare DoH - addr: "https://8.8.8.8/dns-query" # Google DoH # ==================== 智能防污染插件 ==================== # 智能防污染处理器(核心功能) - tag: smart_fallback_handler type: smart_fallback args: primary: $china-dns # 主上游:国内DNS secondary: $overseas-dns # 备用上游:国际DNS china_ip: # CN IP地址表文件 - "/data/chn_ip.txt" # IPv4地址段 - "/data/chn_ipv6.txt" # IPv6地址段(可选) timeout: 2000 # 超时2秒 always_standby: false # 顺序查询(节省资源) verbose: true # 启用详细日志 # ==================== 主处理序列 ==================== - tag: main type: sequence args: # 规则1:匹配特定域名规则 # 注意:这里的规则将通过Web界面动态添加和管理 # 例如:添加OpenAI规则后会自动生成: # - matches: qname $domains_openai # exec: $china-dns # 默认处理:所有未匹配的域名使用智能防污染 - exec: $smart_fallback_handler # ==================== DNS服务器配置 ==================== - tag: udp_server type: udp_server args: entry: main listen: ":53" - tag: tcp_server type: tcp_server args: entry: main listen: ":53" # ==================== 引入动态规则 ==================== # 注意:规则文件将通过Web界面动态生成和管理 # 请确保 config.d/rules 目录存在,或者暂时注释掉此行 include: # - "/usr/local/yltx-dns/config.d/rules/*.yaml" # 动态规则文件