【发布时间】:2014-09-18 00:34:28
【问题描述】:
当我尝试将网页加载到终端时,它会给出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
clean all 并再次尝试但没有运气。
但如果我使用 IP 而不是域名,它就可以正常工作。
[root@localhost kevin]# curl http://173.194.46.0
请问有什么线索吗?
【问题讨论】:
-
运行命令
nslookup google.com得到什么结果? -
另外,如果你运行
cat /etc/resolv.conf,你会得到什么结果? -
这里是 nslookup
[root@localhost run]# nslookup google.com Server: 192.168.1.254 Address: 192.168.1.254#53的结果 -
这里是 resolv.conf
[root@localhost run]# cat /etc/resolv.conf # Generated by NetworkManager nameserver 192.168.1.254
标签: linux curl terminal fedora