2

I'm trying to use pycurl to download test page using different resolvers.

>>> pycurl.version
'PycURL/7.19.3.1 libcurl/7.35.0 WinSSL'

I tried:

c = pycurl.Curl()
c.setopt(c.DNS_SERVERS, '1.2.3.4')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pycurl.error: (4, '')

It happens on Linux and Windows equally. What am I doing wrong?

Can I use different resolvers with urllib2?

Felix Frank
  • 8,125
  • 1
  • 23
  • 30

1 Answers1

3

From http://curl.haxx.se/libcurl/c/libcurl-errors.html

Error 4

CURLE_NOT_BUILT_IN (4)

A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl.

My guess is that the underlying libcurl c library was not compiled with the c-ares library included.

To resolve this it may require compiling libcurl yourself and enabling c-ares in the configure script.

urllib2 might be an option see Tell urllib2 to use custom DNS

Community
  • 1
  • 1
Paul Rooney
  • 20,879
  • 9
  • 40
  • 61