The common question in curl is
why my browser, dig and wget work except curl.
the error message looks like this
curl_resolver_getaddrinfo
https://github.com/curl/curl/blob/fe7b64228d553274f780ebc98a05a9ae266df828/lib/asyn-thread.c
Use autoconf, then got an error
intall automake libtool
reference:
After configuring, I got following errors:
run configure with –without-ssl, then got another error
Found answer here
https://askubuntu.com/questions/27677/cannot-find-install-sh-install-sh-or-shtool-in-ac-aux?ssl_
let autoreconf install package for you
re-run with debug symbol
run gdb with curl
curl loads lib after running it, so set the first breakpoint on curl_easy_init.
After running it, you're able to set breakpoint in any function in curl .
resovler breakpoint
this might be the place where curl resolve the url
https://github.com/curl/curl/blob/fe7b64228d553274f780ebc98a05a9ae266df828/lib/url.c#L3305
from here we can see Curl_resolv_timeout
is the function to handle resolver
https://github.com/curl/curl/blob/fe7b64228d553274f780ebc98a05a9ae266df828/lib/url.c#L3378
getaddrinfo
returned -2 then curl return host cannot be resovled.