curl-and-python

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

From: Dima Tisnek via curl-and-python <curl-and-python_at_cool.haxx.se>
Date: Thu, 25 Aug 2016 20:57:55 +0200

At least run depends32 to validate pycurl and curl.exe are linked to
same libraries.

On 25 August 2016 at 20:29, Peter Binney <peter.binney_at_gmail.com> wrote:
> Hi - many thanks for replying but I'm afraid my problem is on a Windows10
> machine, which doesn't have either of those commands afaik.
>
> Also, the machine resolves the DNS aliases fine from everything I use except
> pycurl : browsers, ping, curl.exe, etc, etc
>
>
>
> On 25 August 2016 at 08:22, Dima Tisnek <dimaqq_at_gmail.com> wrote:
>>
>> Run strace and ltrace to figure out why DNS resolution is different.
>>
>> Check your nsswitch.conf and understand what it does (not easy).
>>
>> Proceed from there
>>
>>
>> On 24 Aug 2016 19:52, "Peter Binney via curl-and-python"
>> <curl-and-python_at_cool.haxx.se> wrote:
>>>
>>> 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
>>>
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2016-08-25