yichya / luci-app-xray

(Almost) full feature Xray client for OpenWrt
Mozilla Public License 2.0
554 stars 328 forks source link

重定向局域网 DNS 查询流量 / Redirect subnets dns queries #346

Closed tsanie closed 9 months ago

tsanie commented 9 months ago

增加一个开关,启用后局域网内客户端 DNS 查询请求一律送往 Xray,无论其 DNS 服务器设置的是什么。

Add a switch. After enabling it, all client DNS query requests in the LAN will be sent to Xray, regardless of its DNS server settings.

yichya commented 9 months ago

粗看了一下感觉你这个写的似乎有点复杂,要实现这个功能应该不需要动 default_gateway.uc 也不需要关心具体的 LAN 接口名 / IP 段,只需要在 prerouting / output 链上加一个把 53 端口全部导进 Xray 然后在 Xray 里面配一个路由转发一下就行了。。。

tsanie commented 9 months ago

有更好的实现方式自然更棒,那把这个 pr 当成 feature request 吧,麻烦作者实现了。

可能是我的应用场景有点复杂,和 https://github.com/yichya/luci-app-xray/issues/345 描述的场景类似,且我想让不走代理的设备(比如老婆、来客的接入设备)的 dns 请求(或者说任意流量)都不走 Xray。

yichya commented 5 months ago

385