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

同样配置,返回了无法访问的ipv6地址 #272

Closed
dream10201 opened this issue May 7, 2024 · 16 comments
Closed

同样配置,返回了无法访问的ipv6地址 #272

dream10201 opened this issue May 7, 2024 · 16 comments

Comments

@dream10201
Copy link

dream10201 commented May 7, 2024

~> nslookup redirector.gvt1.com 127.0.0.1                                                         05/07/2024 09:23:37 AM
Server:  jason
Address:  127.0.0.1

Non-authoritative answer:
Name:    redirector.gvt1.com
Addresses:  2404:6800:4005:805::200e
          142.251.222.206

这个IPV6的地址是无法ping通的,然后导致android studio无法正常更新。

相同的配置,原版smartdns在linux上返回正常能访问的ip地址

~> nslookup redirector.gvt1.com 2408:.......                           05/07/2024 09:24:03 AM
Server:  nas
Address:  2408:.......

Non-authoritative answer:
Name:    redirector.gvt1.com
Address:  114.250.70.33

~>                        
@dream10201
Copy link
Author

dream10201 commented May 7, 2024

223.6.6.6返回的IP地址是正常的,164.124.101.2返回的两个地址都ping不通,但是smartdns-rs直接返回了这两个无法ping的地址

bind 127.0.0.1:53
server 164.124.101.2
server 223.6.6.6
server 223.6.6.6 -bootstrap-dns
server 119.29.29.29 -bootstrap-dns

cache-persist yes
cache-file C:/ProgramData/smartdns/cache.smartdns
speed-check-mode tcp:443,ping
response-mode fastest-ip

@mokeyish
Copy link
Owner

mokeyish commented May 7, 2024

这个比较难复现,不同地区返回的不一样。你能分别查查询的这几个上游各返回了什么吗?目前多个上游记录并没有进行合并或者过滤处理。要看看各个上游结果有什么特征,该怎么进行过滤处理。

@dream10201
Copy link
Author

dream10201 commented May 8, 2024

总共两个上游

配置

bind 127.0.0.1:53
server 164.124.101.2
server 223.6.6.6
server 223.6.6.6 -bootstrap-dns
server 119.29.29.29 -bootstrap-dns
cache-persist yes
cache-file C:/ProgramData/smartdns/cache.smartdns
speed-check-mode tcp:443,ping
response-mode fastest-ip

164.124.101.2

返回的两个地址都是无法ping通的

nslookup redirector.gvt1.com 164.124.101.2
Server:  ns.lgdacom.net
Address:  164.124.101.2

Non-authoritative answer:
Name:    redirector.gvt1.com
Addresses:  2404:6800:4005:81a::200e
          142.250.204.110

223.6.6.6

返回的IP可ping通

nslookup redirector.gvt1.com 223.6.6.6
Server:  public2.alidns.com
Address:  223.6.6.6

Non-authoritative answer:
Name:    redirector.gvt1.com
Address:  114.250.70.33

smartdns-rs

直接返回的第一个上游的地址

nslookup redirector.gvt1.com 127.0.0.1
Server:  jason
Address:  127.0.0.1

Non-authoritative answer:
Non-authoritative answer:
Name:    redirector.gvt1.com
Addresses:  2404:6800:4005:808::200e
          172.217.24.78

也就是说测速没起作用,响应了两个完全无法使用的IP

@mokeyish
Copy link
Owner

mokeyish commented May 8, 2024

有些服务器ping是关掉的。tcp 测得是能否创建连接,可能是代理服务器。是网站,可以试试改成 http 或者 https

@dream10201
Copy link
Author

这个域名是Android Studio的下载地址
https://redirector.gvt1.com/edgedl/android/studio/install/2023.3.1.18/android-studio-2023.3.1.18-windows.exe
如果返回那两个无法ping通的IP,则这个链接直接无法下载,是不是说明tcp443测试也是NG的,也就是说ping和tcp443测速都没有正常工作,smartdns-rs忽略了223.6.6.6的响应,直接返回了最坏的结果

还有,我用vps测试了,IP地址是可以ping的

root@tz:~# ping 142.250.204.110
PING 142.250.204.110 (142.250.204.110) 56(84) bytes of data.
64 bytes from 142.250.204.110: icmp_seq=1 ttl=108 time=166 ms
64 bytes from 142.250.204.110: icmp_seq=2 ttl=108 time=166 ms
64 bytes from 142.250.204.110: icmp_seq=3 ttl=108 time=166 ms
64 bytes from 142.250.204.110: icmp_seq=4 ttl=108 time=166 ms
64 bytes from 142.250.204.110: icmp_seq=5 ttl=108 time=166 ms
^C
--- 142.250.204.110 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 165.553/165.620/165.766/0.076 ms
root@debian:~
# ping 2404:6800:4005:81a::200e
PING 2404:6800:4005:81a::200e(2404:6800:4005:81a::200e) 56 data bytes
64 bytes from 2404:6800:4005:81a::200e: icmp_seq=1 ttl=115 time=264 ms
64 bytes from 2404:6800:4005:81a::200e: icmp_seq=2 ttl=115 time=264 ms
64 bytes from 2404:6800:4005:81a::200e: icmp_seq=3 ttl=115 time=264 ms
64 bytes from 2404:6800:4005:81a::200e: icmp_seq=4 ttl=115 time=264 ms
64 bytes from 2404:6800:4005:81a::200e: icmp_seq=5 ttl=115 time=264 ms
64 bytes from 2404:6800:4005:81a::200e: icmp_seq=6 ttl=115 time=264 ms
64 bytes from 2404:6800:4005:81a::200e: icmp_seq=7 ttl=115 time=264 ms
^C
--- 2404:6800:4005:81a::200e ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6008ms
rtt min/avg/max/mdev = 263.588/263.767/263.946/0.110 ms

@dream10201
Copy link
Author

两个上游响应的ip,一个能ping一个不能ping,按理不应该是选择能ping的作为最优选择么

@mokeyish
Copy link
Owner

@pymumu 大佬你这里的逻辑是怎样的?查询 IPv6 ping 不成功,但是对应后台查的 IPv4 ping 可以,直接给 IPv6 的查询返回 SOA?

@pymumu
Copy link
Contributor

pymumu commented May 16, 2024

默认是先ping,200ms后会用tcping:80,在200ms后tcping:443,都ping不通,就会优选一个IP地址。这个优选的策略是,命中次数最多的IP。

@mokeyish
Copy link
Owner

好的,谢谢。@pymumu 这样200ms不导致响应慢吗?

另外,命中次数是指多个上游返回的ip重叠数最高的那个?

@pymumu
Copy link
Contributor

pymumu commented May 16, 2024

ping不通的情况下,响应会变长。这里一个优化点是,如果所有查询结果只有一个IP地址的情况下,是不进行测速的。

@mokeyish
Copy link
Owner

@mokeyish
Copy link
Owner

@dream10201 你下载这个版本试试,https://github.com/mokeyish/smartdns-rs/actions/runs/9240086699 双栈优选和测速部分都重写了。

@pymumu 我再确认下。双栈优选

  • 当不开启 dualstack_ip_allow_force_aaaa

    • 查询 IPv4 时,是不是不作任何处理?(你文档说:smartdns默认情况下总是会返回IPV4地址)
    • 查询 IPv6 时,当对应 IPv4 快过阈值,IPv6 返回 SOA。使之只能查询到更快的 IPv4 地址。
  • 当开启 dualstack_ip_allow_force_aaaa

    • 查询 IPv4 时,发现存在 IPv6 地址,就返回 SOA。
    • 查询 IPv6 是,不做处理。

@pymumu
Copy link
Contributor

pymumu commented May 26, 2024

默认情况只要上游返回ipV4,也一定返回ipv4给客户端

那个开关开启后,v6速度比v4快时,v4会返回SOA

@dream10201
Copy link
Author

@mokeyish 用测试版没再复现到当前问题。

@mokeyish
Copy link
Owner

那就是解决了? @dream10201

@dream10201
Copy link
Author

是的 @mokeyish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants