Search code examples
curldnscygwin

cURL --dns-ipv4-addr <ip-address> needs to rebuild libcurl


I'm trying to execute the following command line with cURL :

curl --dns-ipv4-addr http://10.67.253.23/ localhost/server-state

and I keep receiving the following error :

curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.

After some research, it seems that I need to rebuild libcurl. See http://curl.haxx.se/docs/faq.html at section :

5.9 How does libcurl resolve host names?

Question : Does anyone know how to rebuild libcurl so as to use --dns-ipv4-addr option ?


Solution

  • You need to build libcurl to use c-ares for name resolving. The "normal" name resolve functions don't allow that kind of control.

    This is also mentioned in the docs for --dns-ipv4-addr.