curl --dns-servers: the installed libcurl version doesn't support this

Hello.
My system FreeBSD 12.4-RELEASE-p7 amd64.
Code:
# curl -A check-sites -LI --connect-timeout 5 --dns-servers 8.8.8.8 [URL]https://test.mysite.org[/URL]
curl: option --dns-servers: the installed libcurl version doesn't support this
curl: try 'curl --help' for more information
Code:
# curl -V
curl 8.5.0 (amd64-portbld-freebsd12.4) libcurl/8.5.0 OpenSSL/1.1.1q zlib/1.2.12 nghttp2/1.58.0
Release-Date: 2023-12-06
Protocols: dict file ftp ftps gopher gophers http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL threadsafe TLS-SRP UnixSockets
Code:
# curl --help dns
Usage: curl [options...] <url>
dns: General DNS options
     --dns-interface <interface> Interface to use for DNS requests
     --dns-ipv4-addr <address> IPv4 address to use for DNS requests
     --dns-ipv6-addr <address> IPv6 address to use for DNS requests
     --dns-servers <addresses> DNS server addrs to use
     --doh-cert-status    Verify the status of the DoH server cert via OCSP-staple
     --doh-insecure       Allow insecure DoH server connections
     --doh-url <URL>      Resolve host names over DoH
 -4, --ipv4               Resolve names to IPv4 addresses
 -6, --ipv6               Resolve names to IPv6 addresses
     --resolve <[+]host:port:addr[,addr]...> Resolve the host+port to this address

How to fix?
 
curl --manual
Code:
       --dns-servers <addresses>
              --dns-servers requires that the underlying libcurl was built to support c-ares.
Use ports and enable CARES option and install.
 
Not having a 12.x system to try, what is the output of "pkg search curl"?
There may multiple versions available for 12.X and you simply need to install a different package.
 
Not having a 12.x system to try, what is the output of "pkg search curl"?
Code:
# pkg search curl
R-cran-RCurl-1.98.1.12         General network client interface for R
R-cran-curl-5.0.2              Modern and Flexible Web Client for R
curl-8.5.0                     Command line tool and library for transferring data with URLs
curlie-1.6.7_16                Frontend to cURL that adds the ease of use of HTTPie
curlpp-0.8.1_4                 C++ wrapper for libcurl
flickcurl-1.26_3               C library for the Flickr API
fusefs-curlftpfs-0.9.2_6       Mount remote FTP directories
grpcurl-1.8.7_11               Command-line tool that lets you interact with gRPC servers
gstreamer1-plugins-curl-1.22.5 GStreamer curl based output plugin
linux-c7-curl-7.29.0_12        Tool for transferring files with URL syntax (Linux CentOS 7.9.2009)
ocaml-ocurl-0.9.2_1            Interface for OCaml to the curl lib
p5-Net-Curl-0.52_1             Perl interface for libcurl
p5-WWW-Curl-4.17_5             Perl extension interface for libcurl
php80-curl-8.0.30              The curl shared extension for php
php81-curl-8.1.24              The curl shared extension for php
php82-curl-8.2.11              The curl shared extension for php
php83-curl-8.3.0.r3            The curl shared extension for php
py39-pycurl-7.45.2             Python interface to libcurl
rexx-curl-2.1.0                External function package providing an interface to the cURL package
 
As far as I can tell ftp/curl doesn't have flavors or slave ports with the option set.


I curl installed from ports.
Then enable the CARES option (disable THREADED_RESOLVER) and rebuild.

Code:
====> DNS resolving options: you have to select exactly one of them
     CARES=off: Asynchronous DNS resolution via c-ares
     THREADED_RESOLVER=on: Threaded DNS resolver
 
Back
Top