-
一直在用v3,没什么毛病,v4还没用上就到v5了,感谢大佬的付出,求个下面的配置怎么转换成v5的呢?就是国内国外域名分流查询用v5怎么写呢? log: plugin:
包含分流的逻辑的插件
缓存
修改应答 ttl
转发请求至本地服务器的插件
转发请求至远程服务器的插件
################ 匹配器插件 ################# 匹配本地域名的插件
匹配非本地域名的插件
匹配本地 IP 的插件
匹配广告域名的插件
|
Beta Was this translation helpful? Give feedback.
Replies: 19 comments 41 replies
-
其实我觉得v3的配置还是很好理解的,v4就有点蒙了,v5更不懂了,理解力有限抱歉 |
Beta Was this translation helpful? Give feedback.
-
俺也一样,v3版本几台稳定运行快一年了没重启过,稳的很。 |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
@nil-ca 感谢,不过你这个primary和secondary好像没体现出来吧? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
马住,等大佬分享 |
Beta Was this translation helpful? Give feedback.
-
V5的debug是不是没用啊?设置debug,日志还是现实info,没有debug记录 |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
@urlesistiana |
Beta Was this translation helpful? Give feedback.
-
v5.0.0-alpha.4 移除 domain_set 和 ip_set v2ray 解包的功能。 |
Beta Was this translation helpful? Give feedback.
-
说实话现在要自己维护这几个geo文件挺麻烦的. 如果是通过 AUR 安装的可以通过 Pacman hook 自动下载 geo 文件. 示例 gist 下面是我自己用的配置和需要的文件连接. # /etc/mosdns/config.yaml
log:
level: info
plugins:
# 缓存
- tag: cache
type: cache
args:
size: 1024
lazy_cache_ttl: 86400
# 转发至本地服务器 DNSPod
- tag: forward_local
type: forward
args:
upstreams:
- addr: https://1.12.12.12/dns-query
# 转发至远程服务器 DNS.SB
- tag: forward_remote
type: forward
args:
upstreams:
- addr: 45.11.45.11
- addr: https://45.11.45.11/dns-query
# fallback 用本地服务器 sequence
# 返回不包含本地 ip 则 reject
- tag: local_ip_sequence
type: sequence
args:
- exec: $forward_local
- matches: resp_ip &/etc/mosdns/CN-ip-cidr.txt
exec: accept
- exec: drop_resp # v5.1.2 以后不能用 reject
# fallback 用远程服务器 sequence
- tag: remote_sequence
type: sequence
args:
- exec: $forward_remote
- exec: accept
# fallback 用远程服务器 sequence
- tag: "fallback"
type: "fallback"
args:
primary: local_ip_sequence
secondary: remote_sequence
threshold: 500
always_standby: true
# 主要的运行逻辑插件
# sequence 插件中调用的插件 tag 必须在 sequence 前定义,
# 否则 sequence 找不到对应插件。
- tag: main_sequence
type: sequence
args:
- matches: qname &/etc/mosdns/reject-list.txt
exec: reject
- exec: $cache
- matches: has_resp
exec: accept
- matches: qname &/etc/mosdns/direct-list.txt
exec: $forward_local
- matches: has_resp
exec: accept
- exec: $fallback
# 启动 udp 服务器。
- tag: udp_server
type: udp_server
args:
entry: main_sequence
listen: 127.0.0.1:53
- tag: udp_server_v6
type: udp_server
args:
entry: main_sequence
listen: "[::1]:53" |
Beta Was this translation helpful? Give feedback.
-
看到v5正式版发布了,大佬威武,能不能写个国内国外分流的配置模板呢?我看看了wiki,好像还没有这样的模板 |
Beta Was this translation helpful? Give feedback.
-
我也写了一个,比较简单,套用的mosdns的规则文件。 log:
file: ./mosdns.log
level: info
api:
http: "127.0.0.1:9081"
plugins:
- tag: tag_cache
type: cache
args:
size: 10240
lazy_cache_ttl: 259200
dump_file: ./cache.dump
dump_interval: 3600
- tag: forward_alidns
type: forward
args:
upstreams:
- tag: alidns_main
addr: "https://223.5.5.5/dns-query"
- tag: alidns_backup
addr: "https://223.6.6.6/dns-query"
- tag: forward_google
type: forward
args:
concurrent: 3
upstreams:
- tag: tailscale_udp
addr: "100.77.149.73:10053"
- tag: tailscale_tcp
addr: "tcp://100.77.149.73:10053"
enable_pipeline: true
- tag: clash_tcp
addr: "tcp://127.0.0.1:6053"
enable_pipeline: true
- tag: main
type: sequence
args:
- matches:
- qtype 12 # PTR
exec: reject 0 # DNS-Rcode
- matches:
- qtype 65 # HTTPS
exec: reject 0
- exec: prefer_ipv4
- exec: $tag_cache
- matches: has_resp
exec: accept
- matches: qname &/etc/mosdns/rules/china_domain_list.txt &/etc/mosdns/rules/cdn_domain_list.txt &/etc/mosdns/ecs_cn_domain.txt
exec: $forward_alidns
- matches: has_resp
exec: accept
- exec: $forward_google
- type: udp_server
args:
entry: main
listen: 127.0.0.1:5533 |
Beta Was this translation helpful? Give feedback.
-
@yqlbu geosite_cn.txt和这个有什么区别吗? |
Beta Was this translation helpful? Give feedback.
-
更新了一下我的配置 - https://github.com/techprober/mosdns-lxc-deploy , 支持在 PVE 下的 LXC 部署。 |
Beta Was this translation helpful? Give feedback.
-
如果设置了多个上游 在log中怎么看出是哪个上游应答的呢
log
warn的信息中能看到上游的tag "upstream": "pod_doh"
|
Beta Was this translation helpful? Give feedback.
-
各路大佬们,有人可以帮我看看这个v4的配置如何变成v5可用吗? |
Beta Was this translation helpful? Give feedback.
-
想请大家帮忙,针对以下配置给点意见:
配置代码如下: log:
level: info
plugins:
# 缓存
- tag: cache
type: cache
args:
size: 10240
lazy_cache_ttl: 86400
dump_file: ./cache.dump
dump_interval: 600
# 转发至国内DNS,并发查询
- tag: local
type: forward
args:
concurrent: 3
upstreams:
- tag: ali_doh
addr: "https://dns.alidns.com/dns-query"
bootstrap: "211.138.180.2"
enable_pipeline: true
max_conns: 10
- tag: tencent_doh
addr: "https://doh.pub/dns-query"
bootstrap: "211.138.180.2"
enable_pipeline: true
max_conns: 10
- tag: cisco_doh
addr: "https://doh.opendns.com/dns-query"
bootstrap: "211.138.180.2"
enable_pipeline: true
max_conns: 10
# 转发至代理
- tag: clash
type: forward
args:
upstreams:
- addr: 127.0.0.1:1053
# 主运行序列
- tag: main_sequence
type: sequence
args:
# 去广告
- matches:
- qname &./anti-ad-domains.txt
exec: reject
# 动态域名跳过缓存
- matches:
- "!qname &./uncache.txt"
exec: $cache
- matches:
- has_resp
exec: accept
# 命中direct.txt的域名本地解析
- matches:
- qname &./direct.txt
exec: $local
- matches:
- has_resp
exec: accept
# 命中gfw.txt的域名直接转发到代理dns
- matches:
- qname &./gfw.txt
exec: $clash
- matches:
- has_resp
exec: accept
# ddns域名设置ttl
- matches:
- "qname &./uncache.txt"
exec: ttl 60
exec: prefer_ipv6
- matches:
- has_resp
exec: accept
# 其他的请求就查询本地dns
- exec: $local
- matches:
- "!resp_ip &./all_cn_ip.txt"
exec: $clash
- matches:
- has_resp
exec: accept
# 启动监听服务
- tag: udp_server
type: udp_server
args:
entry: main_sequence
listen: :53
- tag: tcp_server
type: tcp_server
args:
entry: main_sequence
listen: :53 |
Beta Was this translation helpful? Give feedback.
说实话现在要自己维护这几个geo文件挺麻烦的.
如果是通过 AUR 安装的可以通过 Pacman hook 自动下载 geo 文件. 示例 gist
下面是我自己用的配置和需要的文件连接.