|
mosdns V4 用了一段时间想升级到V5试试,感觉上手难度远高于V4 了,网上搬了一份配置文件,求大师帮忙看看,一直在报错。
log:
level: debug
file: "/tmp/mosdns.log"
# API 入口设置
api:
http: "0.0.0.0:9080" # 在该地址启动 api 接口。
# 从其他配置文件载入 plugins 插件设置。
# include 的插件会比本配置文件中的插件先初始化。
include: []
plugins:
- tag: "geosite-cn"
type: domain_set
args:
files:
- "/etc/mosdns/direct-list.txt"
- "/etc/mosdns/apple-cn.txt"
- "/etc/mosdns/google-cn.txt"
- tag: "geosite-nocn"
type: domain_set
args:
files:
- "/etc/mosdns/proxy-list.txt"
- "/etc/mosdns/gfw.txt"
- tag: "geoip-cn"
type: ip_set
args:
files: "/etc/mosdns/CN-ip-cidr.txt"
- tag: "force-cn"
type: domain_set
args:
files: "/etc/mosdns/force-cn.txt"
- tag: "force-nocn"
type: domain_set
args:
files: "/etc/mosdns/force-nocn.txt"
- tag: "hosts"
type: hosts
args:
files: "/etc/mosdns/hosts.txt"
- tag: "cache"
type: "cache"
args:
size: 1024
lazy_cache_ttl: 0
dump_file: /etc/mosdns/cache.dump
dump_interval: 600
# 转发至本地服务器的插件
- tag: "forward_local"
type: forward
args:
concurrent: 2
upstreams:
- addr: "https://223.5.5.5/dns-query"
idle_timeout: 86400
- addr: "https://120.53.53.53/dns-query"
idle_timeout: 86400
# 转发至远程服务器的插件
- tag: "forward_remote"
type: forward
args:
concurrent: 2
upstreams:
- addr: "https://8.8.4.4/dns-query"
idle_timeout: 86400
- addr: "https://1.0.0.1/dns-query"
idle_timeout: 86400
- tag: "primary_forward"
type: sequence
args:
- exec: $forward_local
- exec: ttl 60-3600
- matches:
- "!resp_ip $geoip-cn"
- "has_resp"
exec: drop_resp
- tag: "secondary_forward"
type: sequence
args:
- exec: prefer_ipv4
- exec: $forward_remote
- matches:
- rcode 2
exec: $forward_local
- exec: ttl 300-3600
- tag: "final_forward"
type: fallback
args:
primary: primary_forward
secondary: secondary_forward
threshold: 150
always_standby: true
- tag: main_sequence
type: sequence
args:
- exec: $hosts
- exec: query_summary hosts
- matches: has_wanted_ans
exec: accept
- exec: $cache
- exec: query_summary cache
- matches: has_wanted_ans
exec: accept
- exec: query_summary qtype65
- matches:
- qtype 65
# exec: black_hole 127.0.0.1 ::1 0.0.0.0
exec: reject 0
- matches:
- qname $geosite-cn
exec: $forward_local
- exec: query_summary geosite-cn
- matches: has_wanted_ans
exec: accept
- matches:
- qname $force-cn
exec: $forward_local
- exec: query_summary force-cn
- matches: has_wanted_ans
exec: accept
- matches:
- qname $geosite-nocn
exec: $forward_remote
- exec: query_summary geosite-nocn
- matches: has_wanted_ans
exec: accept
- matches:
- qname $force-nocn
exec: $forward_remote
- exec: query_summary force-nocn
- matches: has_wanted_ans
exec: accept
- exec: $final_forward
- tag: "udp_server"
type: "udp_server"
args:
entry: main_sequence
listen: 0.0.0.0:5335
- tag: "tcp_server"
type: "tcp_server"
args:
entry: main_sequence
listen: 0.0.0.0:5335
|
|