首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >wget不工作失败:没有主机路径

问wget不工作失败:没有主机路径
EN

Ask Ubuntu用户
提问于 2021-04-05 18:47:18
回答 2查看 1.6K关注 0票数 2

我用的是Ubuntu 20.04。每次我使用wget

代码语言:javascript
复制
failed: No route to host

每个网站都有。这里有什么问题?

代码语言:javascript
复制
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
代码语言:javascript
复制
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
代码语言:javascript
复制
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.
EN

回答 2

Ask Ubuntu用户

发布于 2021-04-06 14:56:11

ping只接受主机名。来自网址-维基百科:

一个典型的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
EN

Ask Ubuntu用户

发布于 2021-04-11 22:55:47

我所要做的就是拔掉和插件我的路由器。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1329449

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档