-
Notifications
You must be signed in to change notification settings - Fork 21
/
forward.yaml
145 lines (130 loc) · 3.63 KB
/
forward.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
plugins:
# - tag: ecs_shanghai
# type: ecs_handler
# args:
# forward: false
# preset: 61.170.0.0 # 电信,自行修改
# send: false
# mask4: 18
# - tag: ecs_tw
# type: ecs_handler
# args:
# forward: false
# preset: 168.95.0.0
# send: false
# mask4: 16
- tag: ecs_jp
type: ecs_handler
args:
forward: false
preset: 13.78.0.0
send: false
mask4: 17
- tag: ecs_sjc
type: ecs_handler
args:
forward: false
preset: 151.101.48.0
send: false
mask4: 22
- tag: ecs_lax
type: ecs_handler
args:
forward: false
preset: 151.101.196.0
send: false
mask4: 22
# 不应处理本地 DNS 请求,防止死循环。正确顺序应该是 dnsmasq --> OpenClash(可选)--> mosdns。
# - tag: "forward_lan"
# type: forward
# args:
# concurrent: 1
# upstream:
# - addr: "192.168.1.1"
- tag: "forward_local"
type: forward
args:
concurrent: 1
upstreams:
- addr: "218.2.2.2" # 运营商 DNS,自行修改
- addr: "218.4.4.4" # 运营商 DNS,自行修改
- addr: "240e:5a::6666" # 运营商 DNS,自行修改
- addr: "240e:5b::6666" # 运营商 DNS,自行修改
- tag: "forward_alidns"
type: forward
args:
concurrent: 1
upstreams:
- addr: "223.5.5.5"
- addr: "quic://223.6.6.6:853"
- addr: "https://dns.alidns.com/dns-query"
dial_addr: "223.5.5.5"
enable_http3: false
- tag: "forward_dnspod"
type: forward
args:
concurrent: 1
upstreams:
- addr: "https://doh.pub/dns-query"
dial_addr: "120.53.53.53"
enable_http3: false
- tag: "forward_easy"
type: "forward"
args:
concurrent: 1
upstreams:
- addr: "https://doh.apad.pro/dns-query"
bootstrap: "223.5.5.5"
enable_http3: false
- tag: "forward_remote"
type: "forward"
args:
concurrent: 1 # 并发数。每次请求随机选取 concurrent 个 upstreams 发送请求。
# 取最快返回的应答。超过 3 最多选 3 个。默认 1。
upstreams:
- addr: "https://162.159.36.1/dns-query"
enable_http3: false
# socks5: "127.0.0.1:1080" # 目前暂不支持用户名密码认证,只支持基于 TCP 的协议
- addr: "https://162.159.46.1/dns-query"
enable_http3: false
# - addr: "https://doh.opendns.com/dns-query"
# dial_addr: "146.112.41.2"
# enable_http3: false
# - addr: "https://public.dns.iij.jp/dns-query"
# dial_addr: 103.2.57.5
# enable_http3: false
# - addr: "tcp://208.67.220.220:5353" # CISCO OpenDNS
# enable_pipeline: true
- tag: remote_sequence
type: sequence
args:
- exec: prefer_ipv4
- exec: $ecs_sjc
- exec: $forward_remote
- exec: return
- tag: "fallback"
type: "fallback"
args:
primary: forward_easy # easy
secondary: forward_remote # remote
threshold: 360 # 无响应回滚阈值。单位毫秒。默认 500 。
always_standby: true # 副可执行插件始终待命。
- tag: fallback_sequence
type: sequence
args:
- exec: prefer_ipv4
- exec: $ecs_sjc # 默认美国 ECS
- exec: $fallback
- exec: return
- tag: fallback_sequence_ipv6
type: sequence
args:
- exec: prefer_ipv6
- exec: $fallback
- exec: accept
- tag: has_resp_sequence
type: sequence
args:
- matches:
- has_resp
exec: accept