pwrliang
V2EX  ›  Raspberry Pi

可以 ping 通 ip,但是无法通过域名 ping 通

By pwrliang at 2018 年 6 月 18 日 · 5911 次点击

我在家里放置了一个树莓派,搭建了 softether。softether 会提供一个域名 xxxx.softether.net 或者 xxxx.sedns.cn 。问题是这样的,我在家中通过路由器连接网络,该网络下所有设备都无法通过域名 ping 通但是能正确解析到 ip。而互联网(通过公共 wifi,移动数据连接)的其他设备,都可以经域名 /ip ping 通。 所以我想在家中通过域名访问,只能在每个设备上编辑 host 文件,强制映射 ip-域名。家中路由器已经将树莓派设置为 DMZ 主机。

通过互联网连接的设备 ping 树莓派

:~$ ping xxxx.softether.net PING xxxx.softether.net (65.24.224.xx) 56(84) bytes of data.

64 bytes from xxxxxx.insight.res.rr.com (65.24.224.xx): icmp_seq=1 ttl=46 time=200 ms

64 bytes from xxxxxx.insight.res.rr.com (65.24.224.xx): icmp_seq=2 ttl=46 time=35.4 ms

通过家中路由器连接的设备 ping 树莓派

:~ $ ping xxxx.softether.net PING xxxx.softether.net (65.24.224.xx) 56(84) bytes of data.

^C

--- xxxx.softether.net ping statistics ---

9 packets transmitted, 0 received, 100% packet loss, time 8323ms

请问各位,问题出在哪里?该如何解决?

4 条回复  •  2018-11-03 02:45:18 +08:00
wd
   1
wd  
   2018 年 6 月 18 日 via iPhone
设置一个 dns
pwrliang
   2
pwrliang  
OP
   2018 年 6 月 18 日
@wd 您好,能具体一点吗?是在每个设备上把树莓派当作 dns 吗?现在 ping 命令能够解析到正确的 ip,但是接下来就不能 ping 通了,很奇怪。
noword2say
   3
noword2say  
   2018 年 6 月 18 日 via Android
ping 找到的 ip 是公网 ip,ping 通需要双向通,DMZ 主机是树莓派,其他同一个内网的设备可能无法接受到回馈信号?建立个 DNS 服务,然后让路由器的 DNS 解析到这个服务上,用内网 ip 地址解析这个域名,可能就行了吧…同时也不影响外网访问。
zhouyut001
   4
zhouyut001  
   2018 年 11 月 3 日
直接用路由器上的花生殼啊,softether 這帶的 ddns 不好用,你家裡的寬帶是動態 ip,換了 ip,ddns 不會更新的
© 2026 V2EX · 28ms · 3.9.8.5