pymumu / smartdns

A local DNS server to obtain the fastest website IP for the best Internet experience, support DoT, DoH. 一个本地DNS服务器,获取最快的网站IP,获得最佳上网体验,支持DoH,DoT。
https://pymumu.github.io/smartdns/
GNU General Public License v3.0
8.25k stars 1.06k forks source link

ipv6能过,不能用 #1639

Open NoWayda opened 7 months ago

NoWayda commented 7 months ago

问题现象
简要描述问题出现的现象

运行环境

  1. 固件型号

  2. 运营商

  3. smartdns来源以及版本

  4. 涉及的配置(注意去除个人相关信息)

重现步骤

  1. 上游DNS配置。

  2. 访问的域名。

信息收集

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

[2024-01-21 20:11:41,033][NOTICE][ smartdns.c:485 ] smartdns starting...(Copyright (C) Nick Peng pymumu@gmail.com, build: Aug 11 2023 19:38:34) [2024-01-21 20:11:41,036][ INFO][ dns_cache.c:824 ] load cache file /etc/smartdns/smartdns.cache, total 13522 records [2024-01-21 20:11:41,103][ INFO][ dns_server.c:4923] ICMP ping is disabled, no ipv6 icmp check feature [2024-01-21 20:11:41,103][ INFO][ dns_server.c:7194] IPV6 is not ready, disable IPV6 features [2024-01-21 20:11:41,103][ INFO][ dns_client.c:1170] add server 208.67.220.220:53, type: tcp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 146.112.41.2:443, type: https [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 101.101.101.101:443, type: https [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 202.102.134.68:53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 202.102.128.68:53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 119.29.29.29:53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 223.5.5.5:53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 180.76.76.76:53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 114.114.114.114:53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 2620:fe::9:53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 2a11:::53, type: udp [2024-01-21 20:11:41,126][ INFO][ dns_client.c:1170] add server 2408:8888::8:53, type: udp [2024-01-21 20:11:43,030][ INFO][ dns_client.c:3859] request: 659352624-cache.supercachenet.com, qtype: 1, id: 41239, group: default [2024-01-21 20:11:43,030][ INFO][ dns_client.c:3859] request: ip-scan.adspower.net.w.kunluncan.com, qtype: 1, id: 33906, group: in [2024-01-21 20:11:43,030][ INFO][ dns_client.c:3859] request: alb-szz58yy5gj008dcrqz.cn-hongkong.alb.aliyuncs.com, qtype: 1, id: 10114, group: in [2024-01-21 20:11:43,031][ INFO][ dns_client.c:3859] request: alledge-all.qnydns.com, qtype: 28, id: 50325, group: in [2024-01-21 20:11:43,036][ INFO][ dns_client.c:3859] request: gspe85-cn-ssl.ls.apple.com.w.alikunlun.com, qtype: 1, id: 47070, group: in [2024-01-21 20:11:43,036][ INFO][ dns_client.c:3859] request: alb-ntfx6ku695e7rpi0fg.cn-hongkong.alb.aliyuncs.com, qtype: 1, id: 29275, group: in [2024-01-21 20:11:43,036][ INFO][ dns_client.c:3859] request: aapl-maps.qtlcdn.com, qtype: 1, id: 54293, group: in [2024-01-21 20:11:43,036][ INFO][ dns_client.c:3859] request: alb-bh4s6qw92c80lypzrx.cn-hongkong.alb.aliyuncs.com, qtype: 1, id: 39187, group: in [2024-01-21 20:11:43,037][ INFO][ dns_client.c:3859] request: alb-wjvn4lw3dnksiawooe.cn-hongkong.alb.aliyuncs.com, qtype: 1, id: 16257, group: in [2024-01-21 20:11:43,037][ INFO][ dns_client.c:3859] request: alb-xvf9bo0sun3tpt70de.cn-hongkong.alb.aliyuncs.com, qtype: 1, id: 51896, group: in [2024-01-21 20:11:43,088][ INFO][ dns_server.c:833 ] result: alledge-all.qnydns.com, id: 0, index: 1, rtt: -0.1 ms, 2408:8740:31fe:0012:0000:0000:0000:0013 [2024-01-21 20:11:43,088][ INFO][ dns_server.c:833 ] result: alledge-all.qnydns.com, id: 0, index: 2, rtt: -0.1 ms, 2408:8719:b300:0100:0000:0000:0002:0029 [2024-01-21 20:11:43,088][ INFO][ dns_server.c:833 ] result: alledge-all.qnydns.com, id: 0, index: 3, rtt: -0.1 ms, 2408:8719:b300:0100:0000:0000:0002:0028 [2024-01-21 20:11:43,089][ INFO][ dns_server.c:833 ] result: alledge-all.qnydns.com, id: 0, index: 4, rtt: -0.1 ms, 2408:8740:31fe:0012:0000:0000:0000:0012

主要是这两条 [2024-01-21 20:11:41,103][ INFO][ dns_server.c:4923] ICMP ping is disabled, no ipv6 icmp check feature [2024-01-21 20:11:41,103][ INFO][ dns_server.c:7194] IPV6 is not ready, disable IPV6 features openwrt是有ipv6的,不管是客户端还是openwrt也都是能ping通ipv6的。IPv6 test也都能过。 但是就是显示以上两条log,以及IPv6的ip也一直都是rtt: -0.1 ms 小白求解~

NoWayda commented 7 months ago

双栈优选是打开的,测速响应都是默认的~

PikuZheng commented 7 months ago
[2024-01-21 20:11:41,103][ INFO][ dns_server.c:4923] ICMP ping is disabled, no ipv6 icmp check feature

当smartdns未以root权限运行时,出现此问题(linux的限制)

NoWayda commented 7 months ago

能求个openwrt root权限运行smartdns的设置或者代码吗

PikuZheng commented 7 months ago

能求个openwrt root权限运行smartdns的设置或者代码吗

安装运行的问题,不是配置问题。 建议卸载后下载release版安装

NoWayda commented 7 months ago

能求个openwrt root权限运行smartdns的设置或者代码吗

安装运行的问题,不是配置问题。 建议卸载后下载release版安装

卸载重装release版本无效 卸载重装openwrt软件源42版本后无效。 请问还有其他方法吗?

pymumu commented 7 months ago

你的openwrt没有ping ipv6的权限,所以smartdns自动关闭ipv6特性了。

NoWayda commented 7 months ago

你的openwrt没有ping ipv6的权限,所以smartdns自动关闭ipv6特性了。

大佬有没有什么解决方案 实在不想重刷了

pymumu commented 7 months ago

先看openwrt路由器有没有获取到ipv6的地址吧。

NoWayda commented 7 months ago

先看openwrt路由器有没有获取到ipv6的地址吧。

确定获取到了。纯ipv6网站能访问。ipv6-test 10分完美。openwrt ping6也没问题。

NoWayda commented 7 months ago

哦 有个细节不知道是不是影响。我是openclash接管所有 然后上游smartdns。openclash IPv6是tproxy。

pymumu commented 7 months ago

你路由器中无法ping通ipv6,导致smartdns禁用了ipv6功能。

NoWayda commented 7 months ago

你路由器中无法ping通ipv6,导致smartdns禁用了ipv6功能。

openwrt,PC客户端都可以ping通ipv6

root@OpenWrt:~# ping -6 www.baidu.com PING www.baidu.com (2408:871a:2100:3:0:ff:b025:348d): 56 data bytes 64 bytes from 2408:871a:2100:3:0:ff:b025:348d: seq=0 ttl=55 time=16.077 ms 64 bytes from 2408:871a:2100:3:0:ff:b025:348d: seq=1 ttl=55 time=16.293 ms 64 bytes from 2408:871a:2100:3:0:ff:b025:348d: seq=2 ttl=55 time=16.127 ms 64 bytes from 2408:871a:2100:3:0:ff:b025:348d: seq=3 ttl=55 time=16.087 ms --- www.baidu.com ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max = 16.077/16.146/16.293 ms

正在 Ping www.a.shifen.com [2408:871a:2100:3:0:ff:b025:348d] 具有 32 字节的数据: 来自 2408:871a:2100:3:0:ff:b025:348d 的回复: 时间=16ms 来自 2408:871a:2100:3:0:ff:b025:348d 的回复: 时间=18ms 来自 2408:871a:2100:3:0:ff:b025:348d 的回复: 时间=16ms 来自 2408:871a:2100:3:0:ff:b025:348d 的回复: 时间=26ms

2408:871a:2100:3:0:ff:b025:348d 的 Ping 统计信息: 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失), 往返行程的估计时间(以毫秒为单位): 最短 = 16ms,最长 = 26ms,平均 = 19ms

NoWayda commented 7 months ago

我搜索了一下类似问题,可能这个issue跟我遇到的差不多。 https://github.com/pymumu/smartdns/issues/1589

并且有一些-0.1ms的我在openwrt或者客户端里是能ping通的

pymumu commented 7 months ago

发debug日志把,启动的时候的。

说了,你这个问题是smartdns检测到ipv6不工作,自动禁用了ipv6相关的功能。

PikuZheng commented 7 months ago

我感觉更像是没有以root权限启动。如果是 openwrt.ai 出来的固件,可能部分版本会有这个问题(插件争抢/冲突?)

NoWayda commented 7 months ago

smartdns.log-20240122-095450.gz 原版openwrt下载的release版本命令行安装

PikuZheng commented 7 months ago

smartdns.log-20240122-095450.gz 原版openwrt下载的release版本命令行安装

看起来ipv6没有问题,但ipv6 ping有问题,主要是这几行

[2024-01-22 09:54:43,797][DEBUG][     dns_server.c:976 ] result: mmbiz.qpic.cn, rtt: -0.1 ms, 2408:8719:3100:0041:0000:0000:0000:003f
[2024-01-22 09:54:43,797][ INFO][     dns_server.c:833 ] result: mmbiz.qpic.cn, id: 0, index: 1, rtt: -0.1 ms, 2408:8719:3100:0041:0000:0000:0000:003f
[2024-01-22 09:54:43,797][ INFO][     dns_server.c:833 ] result: mmbiz.qpic.cn, id: 0, index: 2, rtt: -0.1 ms, 2408:8719:3100:0041:0000:0000:0000:0041
NoWayda commented 7 months ago

屏幕截图 2024-01-22 102407 但是openwrt跟客户端都能ping通~

pymumu commented 7 months ago

smartdns.log-20240122-095450.gz 原版openwrt下载的release版本命令行安装

启动时的日志呢?

PikuZheng commented 7 months ago

我的openwrt,但是ipv6有且正常。检测这块出问题了?

root@OpenWrt:~# /usr/sbin/smartdns -f -c /var/etc/smartdns/smartdns.conf
^c
root@OpenWrt:~# cat /var/log/smartdns.log
[2024-01-22 02:47:23,541][NOTICE][       smartdns.c:487 ] smartdns starting...(Copyright (C) Nick Peng <pymumu@gmail.com>, build: Nov 14 2023 23:10:10)
[2024-01-22 02:47:23,544][ INFO][     dns_server.c:5143] ICMP ping is disabled, no ipv6 icmp check feature
[2024-01-22 02:47:23,544][ INFO][     dns_server.c:7496] IPV6 is not ready, disable IPV6 features
root@OpenWrt:~# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP group default qlen 1000
    link/ether 00:50:56:85:ab:66 brd ff:ff:ff:ff:ff:ff
3: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:50:56:85:ab:66 brd ff:ff:ff:ff:ff:ff
    inet 11.20.3.104/24 brd 11.20.3.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 2408:832e:20db:4020:xxxxxxxxxxxxxxxxxx/64 scope global dynamic noprefixroute
       valid_lft 574sec preferred_lft 274sec
    inet6 fd00::104/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe85:ab66/64 scope link
       valid_lft forever preferred_lft forever
NoWayda commented 7 months ago

额,咱俩开头关于IPv6的info一样。然后你看看,是不是所有的IPv6的ip都是-0.1ms

pymumu commented 7 months ago

看你们是不是关闭了测速,关闭测速后,是不会再发起测速的。日志里面的speed也就是-0.1ms

但这不代表IPv6不能使用。

NoWayda commented 7 months ago

没有关闭,且ipv4测速正常,只是所有6是这样的。 屏幕截图 2024-01-22 111419

PikuZheng commented 7 months ago

看你们是不是关闭了测速,关闭测速后,是不会再发起测速的。日志里面的speed也就是-0.1ms

应该是两个问题

root@OpenWrt:~# ping 2001::
PING 2001:: (2001::): 56 data bytes
^C
--- 2001:: ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss

黑洞,但ipv6是可用且正常的

root@OpenWrt:~# cat /var/etc/smartdns/smartdns.conf |grep speed
speed-check-mode none
但是
domain-rules /domain-set:mainland/ -speed-check-mode ping -nameserver mainland

---- 又试了一次 speed-check-mode ping 现象依旧

pymumu commented 7 months ago

ping 2001::这个是检查有没有权限的,不需要是否能通。

只有两个原因:

  1. 配置没有开启测速。
  2. ping没有权限。

目前看只有第一个原因。

PikuZheng commented 7 months ago

root@OpenWrt:~# cat /var/etc/smartdns/smartdns.conf |grep speed speed-check-mode none 但是 domain-rules /domain-set:mainland/ -speed-check-mode ping -nameserver mainland

我检查了我的配置。目前确定在这样设置时,domain-rules的ping对ipv6不起作用 其他是我配置问题(多设备同步配置出问题了

NoWayda commented 7 months ago

ping 2001::这个是检查有没有权限的,不需要是否能通。

只有两个原因:

  1. 配置没有开启测速。
  2. ping没有权限。

目前看只有第一个原因。

我知道是怎么回事了,高级设置里面测速是关闭的,这时候在 域名规则列表 中单独设置测速是无效的~

pymumu commented 7 months ago

改了一下,可以看看。

returnL commented 7 months ago

root@OpenWrt:~# cat /var/etc/smartdns/smartdns.conf |grep speed speed-check-mode none 但是 domain-rules /domain-set:mainland/ -speed-check-mode ping -nameserver mainland

我检查了我的配置。目前确定在这样设置时,domain-rules的ping对ipv6不起作用 其他是我配置问题(多设备同步配置出问题了

我也碰到了类似的情况。全局测速关闭了,domain-rules里写了测速,然后同一个域名的IPv4有测速,IPv6没有测速