Closed ghost closed 3 years ago
我看之前版本的防火墙规则里,dns劫持是劫持到本机的53端口的,也就是交给dnsmasq处理。
-A PREROUTING -p tcp -m tcp --dport 53 -m comment --comment dns_hijack -j REDIRECT --to-ports 53
-A PREROUTING -p udp -m udp --dport 53 -m comment --comment dns_hijack -j REDIRECT --to-ports 53
但是新版本里,dns是劫持到7874端口的,但是clash监听的是127.0.0.1:7874,而不是0.0.0.0:7874,不是很懂iptables,不知道这样劫持会不会导致局域网设备无法访问到dns解析服务器?
-A PREROUTING -p tcp -m tcp --dport 53 -m comment --comment dns_hijack -j REDIRECT --to-ports 7874
-A PREROUTING -p udp -m udp --dport 53 -m comment --comment dns_hijack -j REDIRECT --to-ports 7874
另外,这样也绕过了dnsmasq,相当于把所有dns解析直接交给clash处理,这样在性能上会不会有问题?
我看/init.d/openclash文件里原来的写法是:
uci get dhcp.@dnsmasq[0].port 2>/dev/null || echo 53
现在改成了
uci -q get dhcp.@dnsmasq[0].port || echo $dns_port
这样劫持端口从53变成了设置的clash的7874端口,不知道这个改动是什么原因。
应该是从这个commit开始的: https://github.com/vernesong/OpenClash/blob/4a9f876575b61a53ab590253d04881b7f1c0c8ca/luci-app-openclash/root/etc/init.d/openclash
1.表现为路由器本身可以正常访问网络,但下挂的局域网设备域名解析全部失败, 2.在路由器上dig domain @127.0.0.1看,或者dig domain @127.0.0.1 -p 7874(Clash的DNS端口),DNS解析是正常的,fake ip也在工作,clash也在工作,甚至web ui上的节点测速都可以正常进行。 在路由器上访问各种IP测试节点看,分流规则也是正常工作的。 3.但在局域网设备上dig domain @网关IP,无法返回任何结果。
最近一次的release版本是正常的,不清楚具体是之后的哪个版本引入的问题。
调试日志如下: