smartdns icon indicating copy to clipboard operation
smartdns copied to clipboard

如果ipv4,ipv6地址延迟结果非常近,那么网站打开速度很慢

Open gavin8282 opened this issue 2 years ago • 3 comments

问题现象
简要描述问题出现的现象 1、如果访问的网站是双栈协议且相应速度接近,那么网站打开速度非常慢,甚至无法访问。例如日志中的“ image.baidu.com”; 2、在这种情况下如何优先使用ipv4解析地址? 运行环境

  1. 固件型号
    ubuntu-22.04
  2. 运营商
    联通
  3. smartdns来源以及版本 github下载 G@Rpi:~$ smartdns -v smartdns 1.2023.05.07-1641
  4. 涉及的配置(注意去除个人相关信息) cat /etc/smartdns/smartdns.conf server-name g-router-smartdns bind :533 bind-tcp :533 force-qtype-SOA 65 prefetch-domain yes speed-check-mode tcp:443,tcp:80,ping response-mode fastest-ip cache-size 4096 audit-enable yes audit-file /var/log/smartdns-audit.log audit-size 128K audit-num 2

重现步骤

  1. 上游DNS配置。
    server-tcp 114.114.114.114 -bootstrap-dns server-https https://dns.alidns.com/dns-query server-https https://dns.pub/dns-query
  2. 访问的域名。
    image.baidu.com,fanyi.baidu.com

信息收集

  1. 将/var/log/smrtdns.log日志作为附件上传(注意去除个人相关信息)。
  2. 如进程异常,请将coredump功能开启,上传coredump信息文件,同时上传配套的smartdns进程文件。
    在自定义界面,开启设置->自定义设置->生成coredump配置,重现问题后提交coredump文件 coredump文件在/tmp目录下

[2023-08-04 17:13:30,800] 10.0.2.254 query image.baidu.com, type 1, time 0ms, speed: 18.9ms, result 112.80.248.122 [2023-08-04 17:13:30,825] 10.0.2.254 query image.baidu.com, type 28, time 26ms, speed: 18.1ms, result 2408:873d:1022:107e:0:ff:b0bc:25e [2023-08-04 17:15:49,432] 10.0.2.254 query webmap1.bdimg.com, type 28, time 0ms, speed: 18.5ms, result 2408:872b:e02:9::745f:1b23 [2023-08-04 17:15:49,432] 10.0.2.254 query webmap1.bdimg.com, type 1, time 0ms, speed: 19.3ms, result 58.243.203.35

gavin8282 avatar Aug 04 '23 09:08 gavin8282

百度终于有ipv6了? 所以结果是ipv6比ipv4慢?如果改用ping测速呢?

PikuZheng avatar Aug 04 '23 10:08 PikuZheng

问题现象 简要描述问题出现的现象 1、如果访问的网站是双栈协议且相应速度接近,那么网站打开速度非常慢,甚至无法访问。例如日志中的“ image.baidu.com”; 2、在这种情况下如何优先使用ipv4解析地址? 运行环境

  1. 固件型号 ubuntu-22.04
  2. 运营商 联通
  3. smartdns来源以及版本 github下载 G@Rpi:~$ smartdns -v smartdns 1.2023.05.07-1641
  4. 涉及的配置(注意去除个人相关信息) cat /etc/smartdns/smartdns.conf server-name g-router-smartdns bind :533 bind-tcp :533 force-qtype-SOA 65 prefetch-domain yes speed-check-mode tcp:443,tcp:80,ping response-mode fastest-ip cache-size 4096 audit-enable yes audit-file /var/log/smartdns-audit.log audit-size 128K audit-num 2

重现步骤

  1. 上游DNS配置。 server-tcp 114.114.114.114 -bootstrap-dns server-https https://dns.alidns.com/dns-query server-https https://dns.pub/dns-query
  2. 访问的域名。 image.baidu.com,fanyi.baidu.com

信息收集

  1. 将/var/log/smrtdns.log日志作为附件上传(注意去除个人相关信息)。
  2. 如进程异常,请将coredump功能开启,上传coredump信息文件,同时上传配套的smartdns进程文件。 在自定义界面,开启设置->自定义设置->生成coredump配置,重现问题后提交coredump文件 coredump文件在/tmp目录下

[2023-08-04 17:13:30,800] 10.0.2.254 query image.baidu.com, type 1, time 0ms, speed: 18.9ms, result 112.80.248.122 [2023-08-04 17:13:30,825] 10.0.2.254 query image.baidu.com, type 28, time 26ms, speed: 18.1ms, result 2408:873d:1022:107e:0:ff:b0bc:25e [2023-08-04 17:15:49,432] 10.0.2.254 query webmap1.bdimg.com, type 28, time 0ms, speed: 18.5ms, result 2408:872b:e02:9::745f:1b23 [2023-08-04 17:15:49,432] 10.0.2.254 query webmap1.bdimg.com, type 1, time 0ms, speed: 19.3ms, result 58.243.203.35

貌似 DNS pod 的 DoH 是这个 https://doh.pub/dns-query

CallMeR avatar Aug 04 '23 13:08 CallMeR

错误归因,看你的描述是因为百度的IPV6地址响应速度差不多但实际应用层面慢或不可用,浏览器默认优先使用IPV6地址发起连接。 没什么好办法除非drop掉AAAA响应,或者你不怕麻烦碰到慢的时候就浏览器控制台抓慢域名手动添加address /[*|-.]domain/[ip1[,ip2,...]|-|-4|-6|#|#4|#6] 规则来强制走IPV4 现阶段国内IPV6就是这个样子,看起来能用,实际上藏着坑,还不算IPV6路由更差等ISP层面因素,反正我是几乎完全不使用IPV6来访问服务

Mosney avatar Sep 04 '23 21:09 Mosney