-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yaml
84 lines (70 loc) · 1.56 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
log:
level: info
api:
listen: 127.0.0.1:9088
secret: admin
upstreams:
- tag: AliDNS
type: tls
address: 223.5.5.5
- tag: OpenDNS
type: tls
address: 208.67.222.222
- tag: GoogleDNS
type: tls
address: 8.8.8.8
- tag: WorldDNS # 并发请求,防止应某些原因请求失败
type: parallel
upstreams:
- OpenDNS
- GoogleDNS
plugin-matchers:
- tag: geosite
type: geosite
args:
type: sing
path: /etc/cdns/geosite.db # 填写 geosite (sing-box) 位置
code: gfw
plugin-executors:
- tag: cache
type: memcache
args:
dump-file: /tmp/dns.cache
dump-interval: 10s
workflows:
- tag: main
rules:
- exec: # 若命中缓存,则直接返回缓存结果
- plugin:
tag: cache
args:
mode: restore
return: true
- match-or: # 屏蔽 AAAA 和 HTTPS 请求
- qtype:
- 28 # AAAA
- HTTPS
exec:
- return: success # 生成空请求
- match-or: # GFW 列表采用 WorldDNS 查询,否则采用 AliDNS 查询
- plugin:
tag: geosite
args: gfw
exec:
- upstream: WorldDNS
else-exec:
- upstream: AliDNS
- exec:
- plugin: # 缓存结果
tag: cache
args:
mode: store
listeners:
- tag: listener-tcp
type: tcp
listen: :53
workflow: main
- tag: listener-udp
type: udp
listen: :53
workflow: main