Some checks failed
Test mosdns / build (push) Has been cancelled
1. 三层异步化
- Exec 方法立即返回
- addToAddressList 异步处理
- batchAddAddresses 异步批处理
2. 跳过耗时检查
- 移除 addressExists() 同步调用
- 依赖Mikrotik内置重复检查
3. 优化重试机制
- 重试次数:3 → 2
- 退避策略:指数 → 线性递增
- 总延迟大幅降低
4. 配置优化
- 连接超时:10s → 5s
- 关闭验证:verify_add: false
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
################ DNS Plugins #################
|
||
plugins:
|
||
|
||
- tag: mikrotik-one
|
||
type: forward
|
||
args:
|
||
concurrent: 1
|
||
upstreams:
|
||
- addr: "udp://10.248.0.1"
|
||
|
||
|
||
- tag: cn-dns
|
||
type: forward
|
||
args:
|
||
concurrent: 6
|
||
upstreams:
|
||
- addr: "udp://202.96.128.86"
|
||
- addr: "udp://202.96.128.166"
|
||
- addr: "udp://119.29.29.29"
|
||
- addr: "udp://223.5.5.5"
|
||
- addr: "udp://114.114.114.114"
|
||
- addr: "udp://180.76.76.76"
|
||
|
||
|
||
- tag: jp-dns
|
||
type: forward
|
||
args:
|
||
concurrent: 4 # 同步向 3 条上游并发查询
|
||
upstreams:
|
||
- addr: "tls://1dot1dot1dot1.cloudflare-dns.com"
|
||
dial_addr: "1.1.1.1"
|
||
enable_pipeline: true
|
||
- addr: "tls://1dot1dot1dot1.cloudflare-dns.com"
|
||
dial_addr: "1.0.0.1"
|
||
enable_pipeline: true
|
||
- addr: "tls://dns.google"
|
||
dial_addr: "8.8.8.8"
|
||
enable_pipeline: true
|
||
- addr: "tls://dns.google"
|
||
dial_addr: "8.8.4.4"
|
||
enable_pipeline: true
|
||
|
||
# MikroTik Address List 插件 - 处理 Amazon 相关域名
|
||
# 示例:将地址列表改为 gfw
|
||
- tag: mikrotik_amazon
|
||
type: mikrotik_addresslist
|
||
args:
|
||
host: "10.248.0.1"
|
||
port: 9728
|
||
username: "admin"
|
||
password: "szn0s!nw@pwd()"
|
||
use_tls: false
|
||
timeout: 5 # 减少连接超时时间
|
||
address_list4: "gfw" # 改为 gfw,插件会自动创建这个地址列表
|
||
mask4: 24
|
||
comment: "amazon_domain"
|
||
timeout_addr: 86400
|
||
cache_ttl: 86400
|
||
verify_add: false # 关闭验证,提升性能 |