curl-and-python

pycurl error 6, 'Could not resolve: ... Domain name not found'

From: Peter Binney via curl-and-python <curl-and-python_at_cool.haxx.se>
Date: Wed, 24 Aug 2016 18:50:08 +0100

I started getting this error when running pycurl to a NAS box on my LAN
after I moved to another ISP (and hence broadband box):
    pycurl.error: (6, 'Could not resolve: nas-29-ee-87 (Domain name not
found)')

Curl does not have the problem when accessing the same URL.
Pycurl does not have the problem when accessing URL's on the Internet.

I am running on Windows10.

pycurl.version shows: PycURL/7.43.0 libcurl/7.47.0 OpenSSL/1.0.2e
zlib/1.2.8 c-ares/1.10.0 libssh2/1.6.0

# START OF pycurl program that errors
import io
import pycurl # Currently (Nov 2014) using 7.19.5 against libCurl 7.37
import sys
url = "http://nas-29-ee-87/" # Change this to "http://www.google.co.uk/"
and no problem

c = pycurl.Curl()
print("fetch(" + url + ") using " + pycurl.version)
c.setopt(pycurl.URL, url)
c.setopt(pycurl.SSL_VERIFYPEER, False) # equivalent to curl's -k /
--insecure
c.setopt(pycurl.SSL_VERIFYHOST, False) # equivalent to curl's ???? Had
to add for NAS access after pyCurl upgrade to 7.21.5 (from 7.19.5)

fPointer = io.BytesIO()
c.setopt(pycurl.WRITEFUNCTION, fPointer.write)
c.perform() # <=== ERRORS ON THIS LINE
# END OF pycurl program that errors

This curl command runs fine on both my Windows10 and a Ubuntu PC on the
same LAN:
    curl http://nas-29-ee-87/

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2016-08-24