cURL --dns-ipv4-addr <ip-address> 需要重建 libcurl

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

我正在尝试使用 cURL 执行以下命令行:

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

我不断收到以下错误:

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

some research, it seems that I need to rebuild libcurl. See http://curl.haxx.se/docs/faq.html 部分之后:

5.9 How does libcurl resolve host names?

问题:有谁知道如何重建 libcurl 以便使用 --dns-ipv4-addr 选项?

您需要构建 libcurl 才能使用 c-ares 进行名称解析。 "normal" 名称解析函数不允许这种控制。

--dns-ipv4-addr 的文档中也提到了这一点。