Today, when we do curl, I suddenly find this error, and the problem is that it didn't happen before.
[Email protected] ~]# Curl www.baidu.com
Curl: (6) Could not resolve host:www.baidu.com; Unknown error
On the Internet to understand, are said to be a DNS problem, so modify the DNS configuration
[Email protected] ~]# vim/etc/resolv.conf
[Email protected] 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
The result is only added nameserver 114.114.114.114 on the Internet, it is possible that the telecommunications DNS has been adjusted, but the specific reasons are still unknown.
Curl: (6) Could not resolve host:www.baidu.com;