找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 7159|回复: 15

[openwrt(x86)] 【求救!】Mosdns和Openclash配置问题,跪求大佬帮忙看一看

[复制链接]
发表于 2022-9-1 20:15 | 显示全部楼层 |阅读模式
本帖最后由 qq517402438 于 2022-9-1 20:23 编辑

求助各位大佬,Mosdns配合Openclash访问被墙的域名时,总是过段时间就会失效无法访问,可能再过一会又好了紧接着又会失效,境内的网站一直都没问题,期间mosdns也在正常运行.
开始以为是mosdns配置问题,试了很多不同配置文件,也换了好几个mosdns的版本(目前是4.1.9),也是一样的问题,mosdns的日志也从来不显示。
因为是自建节点,怀疑过节点,但单独使用openclash也没任何问题,实在是找不到问题在哪儿了,被困扰好几天了,跪求大佬帮忙看一看!!

这是Openclash的设置:


Youtube状态偶尔会好,但大多都是连接不上


这是Openwrt的DNS设置


这是在访问不了外网期间nslookup dig返回的数字


最后附上mosdns的配置
  1. log:
  2.   level: info
  3.   file: '/tmp/mosdns.log'

  4. data_providers:
  5.   - tag: geosite
  6.     file: ./geosite.dat
  7.     auto_reload: true
  8.   - tag: cn
  9.     file: ./cn.dat
  10.     auto_reload: true
  11.   - tag: hosts
  12.     file: ./hosts.txt
  13.     auto_reload: true

  14. plugins:
  15.   # 缓存
  16.   - tag: mem_cache
  17.     type: cache
  18.     args:
  19.       size: 10240
  20.       lazy_cache_ttl: 86400
  21.       cache_everything: true
  22.   
  23.   # Hosts的插件
  24.   - tag: hosts
  25.     type: hosts
  26.     args:
  27.       hosts:
  28.         - "provider:hosts"

  29.   # 调整TTL的插件
  30.   - tag: ttl_short
  31.     type: ttl
  32.     args:
  33.       minimal_ttl: 60
  34.       maximum_ttl: 3600
  35.   - tag: ttl_long
  36.     type: ttl
  37.     args:
  38.       minimal_ttl: 300
  39.       maximum_ttl: 3600

  40.   # 阿里 dns
  41.   - tag: ali
  42.     type: fast_forward
  43.     args:
  44.       upstream:
  45.         - addr: "223.5.5.5"
  46.         - addr: "223.6.6.6"
  47.         - addr: "2400:3200::1"
  48.         - addr: "2400:3200:baba::1"
  49.         - addr: "https://dns.alidns.com/dns-query"
  50.           dial_addr: "223.5.5.5"            
  51.           trusted: true
  52.         - addr: "tls://dns.alidns.com"
  53.           dial_addr: "223.5.5.5"
  54.           trusted: true
  55.           enable_pipeline: true      

  56.   # dnspod
  57.   - tag: dnspod
  58.     type: fast_forward
  59.     args:
  60.       upstream:
  61.         - addr: "119.29.29.29"
  62.         - addr: "https://doh.pub/dns-query"
  63.           dial_addr: "1.12.12.12"
  64.           trusted: true
  65.         - addr: "tls://dot.pub"
  66.           dial_addr: "1.12.12.12"
  67.           trusted: true
  68.           enable_pipeline: true           
  69.       
  70.   # 百度dns
  71.   - tag: baidu
  72.     type: fast_forward
  73.     args:
  74.       upstream:
  75.         - addr: "180.76.76.76"
  76.         - addr: "123.125.81.6"
  77.         - addr: "140.207.198.6"

  78.   # 本地 dns 备用
  79.   - tag: localdns
  80.     type: fast_forward
  81.     args:
  82.       upstream:
  83.         - addr: "202.106.0.20" # 北京联通

  84.   # google
  85.   - tag: google
  86.     type: fast_forward
  87.     args:
  88.       upstream:
  89.         - addr: "tls://8.8.8.8:853"
  90.           enable_pipeline: true
  91.         - addr: "8.8.8.8"
  92.           trusted: true
  93.         - addr: "https://dns.google/dns-query"
  94.           dial_addr: "8.8.8.8"
  95.           trusted: true
  96.           idle_timeout: 30
  97.           enable_pipeline: false
  98.         - addr: "tcp://8.8.8.8"
  99.           enable_pipeline: true

  100.   # openDNS
  101.   - tag: opendns
  102.     type: fast_forward
  103.     args:
  104.       upstream:
  105.         - addr: "208.67.222.222"
  106.         - addr: "208.67.220.220"
  107.         - addr: tls://208.67.220.220:853
  108.           enable_pipeline: true

  109.   # doq 备用
  110.   - tag: adguard
  111.     type: forward
  112.     args:
  113.       upstream:
  114.         - addr: "https://dns.adguard.com/dns-query" # 服务器地址
  115.           ip_addr: # 手动指定服务器的 IP 地址 可以配置多个
  116.             - "94.140.14.140"
  117.             - "94.140.14.141"
  118.           trusted: true # 是否是可信服务器

  119.   # local 序列
  120.   - tag: forward_local
  121.     type: sequence
  122.     args:
  123.       exec:
  124.         - primary:
  125.           - parallel: # 并行
  126.               - - "ali" # 执行序列 #1。
  127.               - - "dnspod" # 执行序列 #2。
  128.               - - "baidu" # 执行序列 #3。
  129.           secondary:
  130.             - localdns # 备用本地
  131.           fast_fallback: 100 # 这里建议设置成 primary 服务器正常延时的 2~5 倍 单位: 毫秒。
  132.           always_standby: true

  133.   # remote 序列
  134.   - tag: forward_remote
  135.     type: sequence
  136.     args:
  137.       exec:
  138.         - primary:
  139.             - parallel: # 并行
  140.                 - - "google" # 执行序列 #1。
  141.                 - - "opendns" # 执行序列 #2。
  142.           secondary:
  143.             - adguard # 备用 adguard
  144.           fast_fallback: 600 # 这里建议设置成 primary 服务器正常延时的 2~5 倍 单位: 毫秒。
  145.           always_standby: true


  146.   ################ 匹配器插件 #################

  147.   # 匹配本地域名的插件
  148.   - tag: query_is_local_domain
  149.     type: query_matcher
  150.     args:
  151.       domain:
  152.         - 'provider:geosite:cn,apple-cn,steam@cn'        

  153.   # 匹配非本地域名的插件
  154.   - tag: query_is_non_local_domain
  155.     type: query_matcher
  156.     args:
  157.       domain:
  158.         - 'provider:geosite:geolocation-!cn'

  159.   # 匹配广告域名的插件
  160.   - tag: query_is_ad_domain
  161.     type: query_matcher
  162.     args:
  163.       domain:
  164.         - 'provider:geosite:category-ads-all'

  165.   # 匹配本地 IP 的插件
  166.   - tag: response_has_local_ip
  167.     type: response_matcher
  168.     args:
  169.       ip:
  170.         - 'provider:cn:cn'

  171.   - tag: main_sequence
  172.     type: sequence
  173.     args:
  174.       exec:      
  175.         # - hosts
  176.         - mem_cache
  177.         - _no_ecs

  178.         - if: query_is_ad_domain
  179.           exec:
  180.             - _new_nxdomain_response
  181.             - _return        

  182.         - if: query_is_local_domain
  183.           exec:
  184.             - forward_local
  185.             - if: response_has_local_ip
  186.               exec:
  187.                 - _return
  188.         
  189.         - if: query_is_non_local_domain
  190.           exec:
  191.             - _prefer_ipv4               # 优先 IPv4
  192.             - forward_remote             # 用远程服务器获取应答
  193.             - if: "! response_has_local_ip"
  194.               exec:
  195.                 - _return
  196.         
  197.         # 剩下的未知域名用 IP 分流。原理类似 china-dns,但更稳定。
  198.         # 详细分流原理请参考 `fallback` 的工作流程。
  199.         - primary:
  200.             - forward_local     # 本地服务器获取应答。
  201.             - ttl_short
  202.             - if: "(! response_has_local_ip) && [_response_valid_answer]"
  203.               exec:
  204.                 - _drop_response            # 丢掉。
  205.           secondary:
  206.             - _prefer_ipv4
  207.             - forward_remote
  208.             - ttl_long
  209.           fast_fallback: 300  # 这里建议设置成 local 服务器正常延时的 2~5 倍。
  210.                                       # 这个延时保证了 local 延时偶尔变高时,其结果不会被 remote 抢答。
  211.                                       # 如果 local 超过这个延时还没响应,可以假设 local 出现了问题。
  212.                                      # 这时用就采用 remote 的应答。单位: 毫秒。
  213.           always_standby: true

  214. servers:
  215.   - exec: main_sequence
  216.     listeners:
  217.       - protocol: tcp
  218.         addr: ":5335"
  219.       - protocol: udp
  220.         addr: ":5335"
复制代码





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-9-1 20:19 | 显示全部楼层
国内别开ipv6最好啊                       还有你ip全放开出来
只能你利害啊                    

点评

谢谢提醒,IP图已经修改了。所以你觉得是IPV6的问题吗,但我单独使用openclash开着IPV6其实是好的,我可以去试试。  详情 回复 发表于 2022-9-1 20:25
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-9-1 20:25 | 显示全部楼层
六七五 发表于 2022-9-1 20:19
国内别开ipv6最好啊                       还有你ip全放开出来
只能你利害啊                ...

谢谢提醒,IP图已经修改了。所以你觉得是IPV6的问题吗,但我单独使用openclash开着IPV6其实是好的,我可以去试试。

点评

我用openclash都不开ipv6的 节点有ipv6的再说 要不然不稳 不是说不能用 是不怎么稳 怕问题多多  详情 回复 发表于 2022-9-1 20:33
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-1 20:33 | 显示全部楼层
qq517402438 发表于 2022-9-1 20:25
谢谢提醒,IP图已经修改了。所以你觉得是IPV6的问题吗,但我单独使用openclash开着IPV6其实是好的,我可 ...

我用openclash都不开ipv6的         节点有ipv6的再说      
要不然不稳     不是说不能用  是不怎么稳   怕问题多多
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-1 20:55 来自手机 | 显示全部楼层
这玩意只能和大雕的plus配合解决ipv6问题,不用ipv6都不需要,clash和帕斯沃都不需要的,自己就正常使用,无论6或者ipv4

点评

准备关了所有的IPV6试一试  详情 回复 发表于 2022-9-1 22:18
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-9-1 22:18 | 显示全部楼层
hcyme 发表于 2022-9-1 20:55
这玩意只能和大雕的plus配合解决ipv6问题,不用ipv6都不需要,clash和帕斯沃都不需要的,自己就正常使用, ...

准备关了所有的IPV6试一试

点评

没有这样的 关会好点 最近也事事多呢  详情 回复 发表于 2022-9-1 22:32
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-1 22:32 | 显示全部楼层
qq517402438 发表于 2022-9-1 22:18
准备关了所有的IPV6试一试

没有这样的          关会好点

最近也事事多呢      

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-2 16:22 | 显示全部楼层
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-16 10:12 | 显示全部楼层
铁子解决了吗?

点评

解决了又没有解决,就是关掉IPV6  详情 回复 发表于 2022-10-18 10:58
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-10-18 10:58 | 显示全部楼层

解决了又没有解决,就是关掉IPV6
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-4-27 13:51 | 显示全部楼层
op的dns上游是clash?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-11-28 09:21 | 显示全部楼层
相同问题,目前怀疑是MOSDNS自动更新失败,导致外网不能解析.
或者open克拉什 卡了没代理MOSDNS的 DNS请求
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-11-28 09:40 来自手机 | 显示全部楼层
看看open克拉什日志是不是每次有问题的时候,都是在重置防火墙规则
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-12-3 21:22 | 显示全部楼层
一样,后面排查是mos解析时好时坏
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2024-2-4 22:25 | 显示全部楼层
本帖最后由 sniper_sh 于 2024-2-4 22:49 编辑

首先,在没有完全吃透mosDNS配置的情况下,最好不要用自定义的配置文件,保持默认就好!open克拉什的dns要设置成使用dnsmasq转发,勾选自定义上游DNS,然后在自定义DNS栏填写且只选一项:软路由的ip地址,端口号5335 (udp),其它的DNS设置项取消勾选,一概不用。回到openwrt的网络接口设置,把DNS地址也必成自己的IP,再回到mosDNS,确保远程DNS服务器的地址格式要写对,错误的格式就会导致DNS解析出错,导致网络不正常。(https://8.8.4.4/dns-queryhttps://8.8.8.8/dns-query这两个地址不要写,大概率报错,推荐去https://dns.sb/doh/查询自己要用的地区DOH地址)。如此的设置就是在保证mosdns作为唯一DNS解析的前提下,又可以执行open克拉什的分流策略。我目前就是这样的,欢迎交流经验
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-25 17:26

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表