hello, I use curl command line under centos, many time and for many websites, the first time I use curl, it will return curl: (6) Couldn't resolve host 'www.....com', then I try the second time, it can work fine, why?
I search on the Internet, someone talk about need to change CURL_TIMEOUT_RESOLVE in the code, but I use the curl command line, how to do this?
thanks.
On what OS/platform and which curl version? Can you show us the curl -V output?
If it is flaky, it is most likely because the servers you have are unreliable. curl's behavior is more set out to be the same every time.
Changing CURL_TIMEOUT_RESOLVE is really no solution, ever, and you'd only find advice to change that on unofficial sites where people try desperate things. curl allows a name resolve to take 5 minutes and if it takes any longer than so you have other problems.