Open w311ang opened 2 years ago
反馈bug/问题模板,提建议请删除
Q:是否搜索了issue (使用 "x" 选择)
A:请求一个未请求过UDP53的域名如facebook.com
~ $ dig @192.168.2.1 facebook.com +tcp ;; communications error to 192.168.2.1#53: end of file ;; communications error to 192.168.2.1#53: end of file
但如果通过UDP53请求了一次,再请求TCP53时则恢复正常
~ $ dig @192.168.2.1 facebook.com +notcp ; <<>> DiG 9.16.27 <<>> @192.168.2.1 facebook.com +notcp ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24047 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;facebook.com. IN A ;; ANSWER SECTION: facebook.com. 0 IN A 31.13.75.35 ;; Query time: 130 msec ;; SERVER: 192.168.2.1#53(192.168.2.1) ;; WHEN: Tue Aug 16 16:54:28 CST 2022 ;; MSG SIZE rcvd: 57 ~ $ dig @192.168.2.1 facebook.com +tcp ; <<>> DiG 9.16.27 <<>> @192.168.2.1 facebook.com +tcp ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18040 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;facebook.com. IN A ;; ANSWER SECTION: facebook.com. 196 IN A 31.13.75.35 ;; Query time: 30 msec ;; SERVER: 192.168.2.1#53(192.168.2.1) ;; WHEN: Tue Aug 16 16:54:53 CST 2022 ;; MSG SIZE rcvd: 57
因为默认劫持所有TCP53到了路由器,若还使用ssrplus该问题会在国内IP的DNS的TCP53上可以复现,因为之前已经在UDP53上请求过facebook.com域名,所以没有出现问题 https://github.com/coolsnowwolf/lede/blob/7e274cbde20495634b240f566ec8b0b77da074b0/package/lean/default-settings/files/zzz-default-settings#L41
~ $ dig @114.114.114.114 twitter.com +tcp ;; communications error to 114.114.114.114#53: end of file ;; communications error to 114.114.114.114#53: end of file ~ $ dig @114.114.114.114 facebook.com +tcp ; <<>> DiG 9.16.27 <<>> @114.114.114.114 facebook.com +tcp ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64967 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;facebook.com. IN A ;; ANSWER SECTION: facebook.com. 5 IN A 31.13.75.35 ;; Query time: 30 msec ;; SERVER: 114.114.114.114#53(114.114.114.114) ;; WHEN: Tue Aug 16 16:58:04 CST 2022 ;; MSG SIZE rcvd: 57
猜测一下问题的原因应该是当请求TCP53时,dnsmasq也在请求上游DNS的TCP53,在使用ssrplus时上游是dns2tcp,不支持TCP请求导致了end of file,在经过UDP53的请求之后dnsmasq缓存了结果,就没有问题了
A:Phicomm K2P OpenWrt R22.7.7 / LuCI Master (git-22.200.61437-0c3c82f)
A:https://github.com/coolsnowwolf/lede/issues/9954#issuecomment-1216382823
解决办法:编译tcp2udp进系统,在启动项添加并到ssh运行
(tcp2udp 127.0.0.1:5335 :5335 >/dev/null 2>&1)&
再换一个支持tcp的上游dns
反馈bug/问题模板,提建议请删除
1.关于你要提交的问题
Q:是否搜索了issue (使用 "x" 选择)
2. 详细叙述
(1) 具体问题
A:请求一个未请求过UDP53的域名如facebook.com
但如果通过UDP53请求了一次,再请求TCP53时则恢复正常
因为默认劫持所有TCP53到了路由器,若还使用ssrplus该问题会在国内IP的DNS的TCP53上可以复现,因为之前已经在UDP53上请求过facebook.com域名,所以没有出现问题 https://github.com/coolsnowwolf/lede/blob/7e274cbde20495634b240f566ec8b0b77da074b0/package/lean/default-settings/files/zzz-default-settings#L41
猜测一下问题的原因应该是当请求TCP53时,dnsmasq也在请求上游DNS的TCP53,在使用ssrplus时上游是dns2tcp,不支持TCP请求导致了end of file,在经过UDP53的请求之后dnsmasq缓存了结果,就没有问题了
(2) 路由器型号和固件版本
A:Phicomm K2P OpenWrt R22.7.7 / LuCI Master (git-22.200.61437-0c3c82f)
(3) 详细日志
A:https://github.com/coolsnowwolf/lede/issues/9954#issuecomment-1216382823