Menu ▾ ▴

#1247 curl: (6) Couldn't resolve host

closed-invalid
5
2013-06-21
2013-06-15
Robert
No

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.

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2013-06-15
    • labels: --> name resolving/DNS
    • assigned_to: Daniel Stenberg
     
  • Daniel Stenberg

    Daniel Stenberg - 2013-06-15

    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.

     
  • Daniel Stenberg

    Daniel Stenberg - 2013-06-16
    • status: open --> pending-invalid
     
  • Daniel Stenberg

    Daniel Stenberg - 2013-06-20
    • status: pending-invalid --> closed-invalid