wget 无法正常工作:没有到主机的路由

wget 无法正常工作:没有到主机的路由

我正在使用 Ubuntu 20.04。每次使用时wget都会出现

failed: No route to host

适用于每个网站。这里可能存在什么问题?

root@zubuntubase:~# ping -i 3 https://dl.winehq.org/wine-builds/winehq.key
ping: https://dl.winehq.org/wine-builds/winehq.key: Name or service not known
root@zubuntubase:~# ping -i 3 google.com
PING google.com(ord36s04-in-x0e.1e100.net (2607:f8b0:4009:800::200e)) 56 data bytes
64 bytes from ord36s04-in-x0e.1e100.net (2607:f8b0:4009:800::200e): icmp_seq=1 ttl=52 time=99.9 ms
64 bytes from ord36s04-in-x0e.1e100.net (2607:f8b0:4009:800::200e): icmp_seq=2 ttl=52 time=64.0 ms
64 bytes from ord36s04-in-x0e.1e100.net (2607:f8b0:4009:800::200e): icmp_seq=3 ttl=52 time=76.9 ms
64 bytes from ord36s04-in-x0e.1e100.net (2607:f8b0:4009:800::200e): icmp_seq=4 ttl=52 time=67.7 ms
64 bytes from ord36s04-in-x0e.1e100.net (2607:f8b0:4009:800::200e): icmp_seq=5 ttl=52 time=68.1 ms
^C
--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 12013ms
rtt min/avg/max/mdev = 64.006/75.326/99.850/12.971 ms
root@zubuntubase:~# ip route
default via 192.168.1.1 dev enp0s3 proto dhcp src 192.168.1.78 metric 100 
192.168.1.0/24 dev enp0s3 proto kernel scope link src 192.168.1.78 
192.168.1.1 dev enp0s3 proto dhcp scope link src 192.168.1.78 metric 100


root@zubuntubase:~# ping 192.168.1.78
PING 192.168.1.78 (192.168.1.78) 56(84) bytes of data.
64 bytes from 192.168.1.78: icmp_seq=1 ttl=64 time=0.368 ms
64 bytes from 192.168.1.78: icmp_seq=2 ttl=64 time=0.079 ms
64 bytes from 192.168.1.78: icmp_seq=3 ttl=64 time=0.081 ms
64 bytes from 192.168.1.78: icmp_seq=4 ttl=64 time=0.081 ms
^C
--- 192.168.1.78 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3030ms
rtt min/avg/max/mdev = 0.079/0.152/0.368/0.124 ms 

I found out my problem virtualbox is only connecting to google services.

答案1

ping仅接受主机名。来自URL - 维基百科

典型的 URL 可以采用以下形式http://www.example.com/index.html,表示协议 ( http)、主机名( www.example.com) 以及文件名 ( index.html)。

另外,来自语法 - 主机名 - 维基百科

主机名由一系列标签用点连接。例如,“en.wikipedia.org”是主机名。每个标签的长度必须为 1 到 63 个字符。整个主机名(包括分隔点)最多包含 253 个 ASCII 字符。

显然,https://dl.winehq.org/wine-builds/winehq.key是 URL,而google.com是主机名。这就是为什么在您的情况下,ping后者可以完美地工作。


进一步阅读:

答案2

我所要做的就是拔下并插入路由器。

相关内容