Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Problem running CURL with the dns option

Writer Matthew Martinez

I'm using curl for a while now to debug my non-prod web services.

When I'm using the --dns-servers option, I always receive an error that this feature was not found:

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

My curl version is 7.47.0, running on Ubuntu 16.04 Desktop.

From curl man page:

This option requires that libcurl was built with a resolver backend that supports this operation.
The c-ares backend is the only such one. (Added in 7.33.0)

Any hint what seems to be the problem ?

Is there another curl package that needs to be installed, or a some optional dependency that I missed?

1 Answer

Okay so after a good amount of time trying to figure this out, I'd like to answer this for future users stumbling upon this problem.

According to StackExchange user bk2204 to my question:

The curl binary that's built for Debian and Ubuntu doesn't contain support for libc-ares. That's because that library can't return both A (IPv4) and AAAA (IPv6) queries in a single response, so if the host you're connecting to uses IPv6 but you don't have IPv6 support, the connection just fails. Since this is a pretty big defect (since many open Wi-Fi access points don't have IPv6), Debian and Ubuntu have compiled it out.

You may be able to get by with using --resolve to manually specify the IP addresses you want to use. Otherwise, if you need to use this feature, you'll have to compile your own curl.

Link to the question for future updates (if any): Problem running CURL with the dns option (Unix & Linux community)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy