PYCURL ERROR 6 - "Could not resolve host" mirrorlist.centos.org "

I have a problem with CentOS 6.4 on Hyper-V. I can not set using yum or ping any DNS address. An ad appeared: Couldn't resolve host 'mirrorlist.centos.org' , etc. I tried to fix this according to this video: http://www.youtube.com/watch?v=2BZHvVpXsg4 , but still nothing. What should I do? yum

ifconfig

ping

+6
source share
4 answers

Check network ... I use a vm player and add a user virtual network (vmnet bridget)

A type:

 ifdown eth0 ifup eth0 yum update 

works for me ....

+9
source

Try adding this line to /etc/hosts

 64.235.47.134 mirrorlist.centos.org 
+1
source

I had the same problem.

After logging into my composite account, the network can connect to the Internet. But my stained glass Manchinsky gunt is not included in the system.

I change the network mode, use the "private network" , then I can connect to the Internet.

Good luck.

+1
source

To write: if you are in the Python shell , try starting a new one. . I know this is not the question, but this is the only top hit from google for this error. The original cause of the problem is still not clear, since curl from the command line loaded the same URL without any problems, and I did not have network problems in any other application at the same time. I made ip link set <ifname> down/up , nmcli con down/up wired without success. I added some of the domains to /etc/hosts , this time did not resolve the problem, but later it worked in another domain. Here is a minimal example for simple testing:

 import pycurl import io s = io.BytesIO() c = pycurl.Curl() c.setopt(pycurl.FOLLOWLOCATION, 1) c.setopt(pycurl.VERBOSE, 1) c.setopt(pycurl.WRITEFUNCTION, s.write) c.setopt(pycurl.URL, 'http://speedtest.ftp.otenet.gr/files/test100k.db') c.perform() s.seek(0) print('Downloaded %u bytes.' % len(s.getvalue())) 
0
source

All Articles