Show hidden characters
config 文件是支持拆分的, v5 版本顺势拆分成了
config.yaml
dat_exec.yaml
dns.yaml
使用前需要更新两个字段
dashboard/mosdns/config/dns.yaml 的 addr 为本地运营商 dns 地址
# local dns
- tag: local
type: forward
args:
concurrent: 1
upstreams:
- addr: "udp://192.168.1.1:53" # 更新为本地 dns 地址, 一般是 网关地址
dashboard/mosdns/config/dat_exec.yaml 的 preset 为本地公网 ip
# 附加 ecs cn 信息
- tag: ecs_cn
type: "ecs_handler"
args:
forward: false # 是否转发来自下游的 ecs
preset: 202.120.2.100 # 发送预设 ecs
send: false # 是否发送 ecs
mask4: 24 # ipv4 掩码。默认 24
mask6: 48 # ipv6 掩码。默认 48
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
2001:4860:4860::6464
"
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
2001:4860:4860::0064
"
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
2001:4860:4860::8844
"
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
2001:4860:4860::8888
"
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
8.8.4.4
"
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
8.8.8.8
"
-
addr
:
"
tls://dns.google
"
dial_addr
:
"
8.8.4.4
"
enable_pipeline
:
true
#
TCP/DoT 启用 RFC 7766 新的 query pipelining 连接复用模式
-
addr
:
"
tls://dns.google
"
dial_addr
:
"
2001:4860:4860::8888
"
enable_pipeline
:
true
-
addr
:
"
tls://dns.google
"
dial_addr
:
"
8.8.8.8
"
enable_pipeline
:
true
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
2001:4860:4860::8844
"
enable_http3
:
true
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
8.8.4.4
"
enable_http3
:
true
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
2001:4860:4860::8888
"
enable_http3
:
true
-
addr
:
"
https://dns.google/dns-query
"
dial_addr
:
"
8.8.8.8
"
enable_http3
:
true
#
cloudflare doh dot h3
-
tag
:
cloudflare
type
:
forward
args
:
concurrent
:
3
upstreams
:
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
2606:4700:4700::1001
"
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
1.0.0.1
"
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
2606:4700:4700::1111
"
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
1.0.0.1
"
-
addr
:
"
tls://1dot1dot1dot1.cloudflare-dns.com
"
dial_addr
:
"
2606:4700:4700::1001
"
enable_pipeline
:
true
#
TCP/DoT 启用 RFC 7766 新的 query pipelining 连接复用模式
-
addr
:
"
tls://1dot1dot1dot1.cloudflare-dns.com
"
dial_addr
:
"
1.0.0.1
"
enable_pipeline
:
true
-
addr
:
"
tls://1dot1dot1dot1.cloudflare-dns.com
"
dial_addr
:
"
2606:4700:4700::1111
"
enable_pipeline
:
true
-
addr
:
"
tls://1dot1dot1dot1.cloudflare-dns.com
"
dial_addr
:
"
1.0.0.1
"
enable_pipeline
:
true
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
2606:4700:4700::1001
"
enable_http3
:
true
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
1.0.0.1
"
enable_http3
:
true
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
2606:4700:4700::1111
"
enable_http3
:
true
-
addr
:
"
https://cloudflare-dns.com/dns-query
"
dial_addr
:
"
1.1.1.1
"
enable_http3
:
true
#
ali doh dot h3
-
tag
:
ali
type
:
forward
args
:
concurrent
:
3
upstreams
:
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
2400:3200:baba::1
"
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
223.5.5.5
"
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
2400:3200::1
"
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
223.6.6.6
"
-
addr
:
"
tls://dns.alidns.com
"
dial_addr
:
"
2400:3200:baba::1
"
enable_pipeline
:
true
-
addr
:
"
tls://dns.alidns.com
"
dial_addr
:
"
223.5.5.5
"
enable_pipeline
:
true
-
addr
:
"
tls://dns.alidns.com
"
dial_addr
:
"
2400:3200::1
"
enable_pipeline
:
true
-
addr
:
"
tls://dns.alidns.com
"
dial_addr
:
"
223.6.6.6
"
enable_pipeline
:
true
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
2400:3200:baba::1
"
enable_http3
:
true
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
223.5.5.5
"
enable_http3
:
true
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
2400:3200::1
"
enable_http3
:
true
-
addr
:
"
https://dns.alidns.com/dns-query
"
dial_addr
:
"
223.6.6.6
"
enable_http3
:
true
#
dnspod doh dot
-
tag
:
dnspod
type
:
forward
args
:
concurrent
:
3
upstreams
:
-
addr
:
"
https://doh.pub/dns-query
"
dial_addr
:
"
1.12.12.12
"
-
addr
:
"
https://doh.pub/dns-query
"
dial_addr
:
"
120.53.53.53
"
-
addr
:
"
tls://dot.pub
"
dial_addr
:
"
1.12.12.12
"
enable_pipeline
:
true
-
addr
:
"
tls://dot.pub
"
dial_addr
:
"
120.53.53.53
"
enable_pipeline
:
true
#
local dns
-
tag
:
local
type
:
forward
args
:
concurrent
:
1
upstreams
:
-
addr
:
"
udp://192.168.1.1:53
"
#
server 失败
-
tag
:
reject_2
type
:
sequence
args
:
-
exec
:
reject 2
#
拒绝响应
-
tag
:
reject_3
type
:
sequence
args
:
-
exec
:
reject 3
#
不支持的操作
-
tag
:
reject_5
type
:
sequence
args
:
-
exec
:
reject 5