[root@localhost ~]# curl www.baidu.com
curl: (6) Could not resolve host: www.baidu.com; 未知的错误
上网了解了一下,都说是DNS的问题,因此修改一下DNS配置
[root@localhost ~]# vim /etc/resolv.conf
[root@centos yum.repos.d]# cat /etc/resolv.conf
# Generated by NetworkManager
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 114.114.114.114 #添加DNS
nameserver 8.8.8.8
结果只是加上了nameserver 114.114.114.114就可以了,网上了解到的可能是电信DNS有调整的缘故,但是具体的原因还是不得而知。
curl: (6) Could not resolve host: www.baidu.com;
原文地址:http://blog.51cto.com/sf1314/2116236