-
Notifications
You must be signed in to change notification settings - Fork 196
/
default.yaml
259 lines (223 loc) · 5.22 KB
/
default.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
log:
level: log_level
file: "log_file"
api:
http: "0.0.0.0:api_port"
include: []
plugins:
- tag: geosite_cn
type: domain_set
args:
files:
- "/var/mosdns/geosite_cn.txt"
- tag: geoip_cn
type: ip_set
args:
files:
- "/var/mosdns/geoip_cn.txt"
- tag: geosite_apple
type: domain_set
args:
files:
- "/var/mosdns/geosite_apple.txt"
- tag: geosite_no_cn
type: domain_set
args:
files:
- "/var/mosdns/geosite_geolocation-!cn.txt"
- tag: whitelist
type: domain_set
args:
files:
- "/etc/mosdns/rule/whitelist.txt"
- tag: blocklist
type: domain_set
args:
files:
- "/etc/mosdns/rule/blocklist.txt"
- tag: greylist
type: domain_set
args:
files:
- "/etc/mosdns/rule/greylist.txt"
- tag: ddnslist
type: domain_set
args:
files:
- "/etc/mosdns/rule/ddnslist.txt"
- tag: hosts
type: hosts
args:
files:
- "/etc/mosdns/rule/hosts.txt"
- tag: redirect
type: redirect
args:
files:
- "/etc/mosdns/rule/redirect.txt"
- tag: adlist
type: domain_set
args:
files:
ADBLOCK_LIST
- tag: local_ptr
type: domain_set
args:
files:
- "/etc/mosdns/rule/local-ptr.txt"
- tag: cloudflare_cidr
type: ip_set
args:
files:
- "/etc/mosdns/rule/cloudflare-cidr.txt"
- tag: lazy_cache
type: cache
args:
size: cache_size
lazy_cache_ttl: cache_survival_time
- tag: forward_xinfeng_udp
type: forward
args:
concurrent: 2
upstreams:
- addr: "114.114.114.114"
- addr: "114.114.115.115"
- tag: forward_local
type: forward
args:
concurrent: concurrent_num
upstreams:
- addr: local_dns
- tag: forward_remote
type: forward
args:
concurrent: concurrent_num
upstreams:
- addr: remote_dns
- tag: forward_remote_upstream
type: sequence
args:
- exec: prefer_ipv4
- exec: ecs_remote
- exec: $forward_remote
- tag: modify_ttl
type: sequence
args:
- exec: ttl minimal_ttl_custom-maximum_ttl_custom
- tag: modify_ddns_ttl
type: sequence
args:
- exec: ttl 5-5
- tag: has_resp_sequence
type: sequence
args:
- matches: qname $ddnslist
exec: $modify_ddns_ttl
- matches: "!qname $ddnslist"
exec: $modify_ttl
- matches: "resp_ip $cloudflare_cidr"
exec: black_hole CLOUDFLARE_IP
- matches: has_resp
exec: accept
- tag: query_is_non_local_ip
type: sequence
args:
- exec: $forward_local
- matches: "!resp_ip $geoip_cn"
exec: drop_resp
- tag: fallback
type: fallback
args:
primary: UNDEFINED
secondary: forward_remote_upstream
threshold: 500
always_standby: true
- tag: apple_domain_fallback
type: fallback
args:
primary: query_is_non_local_ip
secondary: forward_xinfeng_udp
threshold: 100
always_standby: true
- tag: query_is_apple_domain
type: sequence
args:
- matches: "!qname $geosite_apple"
exec: return
- exec: $apple_domain_fallback
- tag: query_is_ddns_domain
type: sequence
args:
- matches: qname $ddnslist
exec: $forward_local
- tag: query_is_local_domain
type: sequence
args:
- matches: qname $geosite_cn
exec: $forward_local
- tag: query_is_no_local_domain
type: sequence
args:
- matches: qname $geosite_no_cn
exec: $forward_remote_upstream
- tag: query_is_whitelist_domain
type: sequence
args:
- matches: qname $whitelist
exec: $forward_local
- tag: query_is_greylist_domain
type: sequence
args:
- matches: qname $greylist
exec: $forward_remote_upstream
- tag: query_is_reject_domain
type: sequence
args:
- matches: qname $blocklist
exec: reject 3
- matches: qname $adlist
exec: reject 3
- matches:
- qtype 12
- qname $local_ptr
exec: reject 3
- matches: qtype 65
exec: reject 3
- tag: main_sequence
type: sequence
args:
- exec: $hosts
- exec: jump has_resp_sequence
- matches:
- "!qname $ddnslist"
- "!qname $blocklist"
- "!qname $adlist"
- "!qname $local_ptr"
exec: $lazy_cache
- exec: $redirect
- exec: jump has_resp_sequence
- exec: $query_is_apple_domain
- exec: jump has_resp_sequence
- exec: $query_is_ddns_domain
- exec: jump has_resp_sequence
- exec: $query_is_whitelist_domain
- exec: jump has_resp_sequence
- exec: $query_is_reject_domain
- exec: jump has_resp_sequence
- exec: $query_is_greylist_domain
- exec: jump has_resp_sequence
- exec: $query_is_local_domain
- exec: jump has_resp_sequence
- exec: $query_is_no_local_domain
- exec: jump has_resp_sequence
- exec: $fallback
- tag: udp_server
type: udp_server
args:
entry: main_sequence
listen: ":listen_port"
- tag: tcp_server
type: tcp_server
args:
entry: main_sequence
listen: ":listen_port"