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] 启用 DNS 劫持后未将 Dnsmasq 中添加的 DNS 转发作为上游 DNS #2720

Closed
4 tasks done
helloworlde opened this issue Sep 27, 2022 · 3 comments
Closed
4 tasks done
Labels
bug Something isn't working Stale

Comments

@helloworlde
Copy link

helloworlde commented Sep 27, 2022

Verify Steps

  • Tracker 我已经在 Issue Tracker 中找过我要提出的问题
  • Latest 我已经使用最新 Dev 版本测试过,问题依旧存在
  • Core 这是 OpenClash 存在的问题,并非我所使用的 Clash 或 Meta 等内核的特定问题
  • Meaningful 我提交的不是无意义的 催促更新或修复 请求

OpenClash Version

v0.45.59-beta

Bug on Environment

Official OpenWrt

Bug on Platform

Linux-amd64(x86-64)

To Reproduce

  1. 在网络 DHCP/DNS 中添加 DNS 转发

image

  1. 启动 OpenClash

Describe the Bug

  1. 查看文档 DNS设置,在启用 DNS 劫持后,会将 OpenClash 作为 Dnsmasq 的唯一上游;
  2. 通过查看代码 change_dns(),发现会在修改之前先保存已有的配置,得到的结果是配置的名称:
$ uci show dhcp.@dnsmasq[0].server
dhcp.cfg01411c.server='127.0.0.1#6053' '127.0.0.1#6553' '223.5.5.5'

$ uci show dhcp.@dnsmasq[0].server |awk -F '.' '{print $2}'
cfg01411c
  1. 随后在 save_dnsmasq_server() 函数中保存了该配置,获取到结果为:
uci get openclash.config.dnsmasq_server
cfg01411c
  1. 成功启动 OpenClash 后,Dnsmasq 中的 DNS 转发改为 OpenClash 的 DNS 服务地址

检查 OpenClash DNS 配置到上游 DNS服务器,发现在 Dnsmasq 中添加的配置并没有出现在 OpenClash 的上游服务器中

OpenClash Log

2022-09-27 12:28:53 第六步:删除 OpenClash 残留文件...
2022-09-27 12:27:53 第五步: 重启 Dnsmasq 程序...
2022-09-27 12:27:53 第四步: 关闭 Clash 主程序...
2022-09-27 12:27:53 第三步: 关闭 OpenClash 守护程序...
2022-09-27 12:27:52 第二步: 删除 OpenClash 防火墙规则...
2022-09-27 12:27:52 第一步: 备份当前策略组状态...

OpenClash Config

No response

Expected Behavior

启用 OpenClash DNS 劫持后,已经在 Dnsmasq 中配置的 DNS 转发应当作为上游服务器添加到 OpenClash 的 DNS 配置中

因为环境配置有限,没有执行全部的脚本检查,请问是否有理解错误或者配置错误;以及启用 DNS 劫持后未将 Dnsmasq 中添加的 DNS 转发作为上游 DNS 是符合预期,谢谢

Screenshots

No response

@helloworlde helloworlde added the bug Something isn't working label Sep 27, 2022
@vernesong
Copy link
Owner

这里不会加,保存只是为了关闭插件后进行还原

@helloworlde
Copy link
Author

这里不会加,保存只是为了关闭插件后进行还原

@vernesong 会考虑增加这个功能吗

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

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

No branches or pull requests

2 participants