Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] UDP DNS返回结果超过512字节时用TCP重新发起查询无法正常返回结果 #1117

Closed
6 tasks done
AllForLandlord opened this issue Mar 19, 2024 · 3 comments
Closed
6 tasks done
Labels
bug Something isn't working

Comments

@AllForLandlord
Copy link

Verify steps

  • 确保你使用的是本仓库最新的的 mihomo 或 mihomo Alpha 版本 Ensure you are using the latest version of Mihomo or Mihomo Alpha from this repository.
  • 如果你可以自己 debug 并解决的话,提交 PR 吧 Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
  • 我已经在 Issue Tracker 中找过我要提出的问题 I have searched on the issue tracker for a related issue.
  • 我已经使用 Alpha 分支版本测试过,问题依旧存在 I have tested using the dev branch, and the issue still exists.
  • 我已经仔细看过 Documentation 并无法自行解决问题 I have read the documentation and was unable to solve the issue.
  • 这是 Mihomo 核心的问题,并非我所使用的 Mihomo 衍生版本(如 OpenMihomo、KoolMihomo 等)的特定问题 This is an issue of the Mihomo core per se, not to the derivatives of Mihomo, like OpenMihomo or KoolMihomo.

Mihomo version

alpha-gb3db113

What OS are you seeing the problem on?

Linux

Mihomo config

dns:
  enable: true
  ipv6: false
  enhanced-mode: redir-host
  listen: 0.0.0.0:7874
  nameserver:
  - 223.5.5.5
  default-nameserver:
  - 223.5.5.5
  - 119.29.29.29
  use-hosts: true

Mihomo log

2024-03-19 09:32:09 level=debug msg="[DNS] www.ai2moe.org --> [] A from udp://223.5.5.5:53"
2024-03-19 09:32:09 level=debug msg="[DNS] resolve www.ai2moe.org from udp://223.5.5.5:53"
2024-03-19 09:32:09 level=debug msg="[DNS] cache hit for www.ai2moe.org., expire at 2024-03-19 01:32:10"
2024-03-19 09:32:09 level=debug msg="[DNS] www.ai2moe.org --> [] A from udp://223.5.5.5:53"
2024-03-19 09:32:09 level=debug msg="[DNS] www.ai2moe.org --> [] HTTPS from udp://223.5.5.5:53"
2024-03-19 09:32:09 level=debug msg="[DNS] resolve www.ai2moe.org from udp://223.5.5.5:53"
2024-03-19 09:32:09 level=debug msg="[DNS] cache hit for www.ai2moe.org., expire at 2024-03-19 01:32:09"
2024-03-19 09:32:09 level=debug msg="[DNS] resolve www.ai2moe.org from udp://223.5.5.5:53"

Description

Describe the Bug

在OpenClash issue提出了此问题,V大表示是内核的问题:vernesong/OpenClash#3811

详见:https://www.v2ex.com/t/1024280
223.5.5.5在进行UDP DNS查询返回A记录过多超过512字节后会重新用TCP进行DNS查询,而在开启openclash(nameserver只用223.5.5.5)的情况下无法正常进行DNS查询。复现网址:www.ai2moe.org。 表现结果为chrome浏览器访问该网站报错DNS_PROBE_FINISHED_NXDOMAIN

而关掉openclash用命令dig +tcp @223.5.5.5 -p 53 www.ai2moe.org返回结果正常。后在PC上手动设置DNS用223.5.5.5,可以正常访问www.ai2moe.org。而开了openclash就无法正常访问。

所以我推测可能openclash或者可能是meta内核对于这种情况的DNS查询有bug,而V大表示是内核的问题。

To Reproduce

openclash用meta内核,在redir-host模式下,DNS设置中启用自定义上游 DNS 服务器,nameserver只勾选223.5.5.5,fallback关掉。
访问www.ai2moe.org,发现无法访问,chrome浏览器报错DNS_PROBE_FINISHED_NXDOMAIN

@AllForLandlord
Copy link
Author

@wwqgtxx
大佬,感谢commit,我刚刚把openclash meta内核升级到alpha-g9c08e93,然后再测试了访问https://www.ai2moe.org/,依旧报错DNS_PROBE_FINISHED_NXDOMAIN

下面是debug的DNS日志:
1

如果需要什么测试结果,请随时回复。

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Mar 23, 2024

试试 d56a439

@AllForLandlord
Copy link
Author

试试 d56a439

测试下来现在可以正常解析了!感谢修复!

下面是日志:
1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants