当我尝试将网页加载到终端时,它会curl: (6) Could not resolve host
出错.
我在我的电脑上有互联网,并尝试从我家的互联网连接.所以我这里没有任何代理涉及.
[root@localhost kevin]# curl http://google.com
curl: (6) Could not resolve host: google.com; Name or service not known
Run Code Online (Sandbox Code Playgroud)
clean all
再试一次,但没有幸运.
但如果我使用IP而不是域名,它可以正常工作.
[root@localhost kevin]# curl http://173.194.46.0
有什么线索吗?
当尝试在 Windows 11 上使用 wsl 2 安装 nvm 时,它会抛出:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0curl: (6) Could not resolve host: raw.githubusercontent.com
Run Code Online (Sandbox Code Playgroud)
当我尝试ping google.com
它时出错,而ping 8.8.8.8
有效!?!
curl ×1
fedora ×1
linux ×1
nvm ×1
terminal ×1
windows-11 ×1
windows-subsystem-for-linux ×1
wsl-2 ×1