Discussion:
curl_easy_perform() return error code 6 (CURLE_COULDNT_RESOLVE_HOST)
palkeo
2008-12-31 14:10:44 UTC
Permalink
Hi all,

I have made a C++ program on my PC, and it use cURL.
On my PC, it works very well, but i want to use it on my server.
I have put the binary on my server, but the call to curl_easy_perform()
always return error code 6, i don't know why.
But i can resolve DNS. If i use the "curl" command to get an url, it works !

Can someone please tell me how to solve this problem ?
Thanks in advance,
palkeo
Dan Fandrich
2008-12-31 18:00:49 UTC
Permalink
Post by palkeo
I have made a C++ program on my PC, and it use cURL.
On my PC, it works very well, but i want to use it on my server.
I have put the binary on my server, but the call to curl_easy_perform() always
return error code 6, i don't know why.
But i can resolve DNS. If i use the "curl" command to get an url, it works !
Can someone please tell me how to solve this problem ?
Thanks in advance,
We need more information to try to help. Starting with the operating system
you're using. Are you resolving IPv4 or IPv6 addresses? Are you using C-Ares?
Does your program work when using numeric IP addresses?
Post by palkeo
Dan
--
http://www.MoveAnnouncer.com The web change of address service
Let webmasters know that your web site has moved
Daniel Stenberg
2008-12-31 21:21:03 UTC
Permalink
Post by palkeo
I have put the binary on my server, but the call to curl_easy_perform()
always return error code 6, i don't know why. But i can resolve DNS. If i
use the "curl" command to get an url, it works !
Are they using the same libcurl? Are they even executing in the same
surrounding or could the libcurl version possibly require a proxy or
something?
--
/ daniel.haxx.se
palkeo
2009-01-01 04:40:49 UTC
Permalink
On my PC where i developed the program, i use Gentoo, and on my server,
Debian stable.
When i have started the binary on my server at the first time, libcurl.so.4
were absent (i had only libcurl.so.3), then i have compiled & installed the
same version of curl my gentoo have (7.18.2).
I am resolving IPv4 addresses, i am not using C-Ares, when i use numeric ip
addresses, it works. It works also with "localhost".
Daniel Stenberg
2009-01-01 13:28:14 UTC
Permalink
Post by palkeo
On my PC where i developed the program, i use Gentoo, and on my server,
Debian stable.
When i have started the binary on my server at the first time, libcurl.so.4
were absent (i had only libcurl.so.3), then i have compiled & installed the
same version of curl my gentoo have (7.18.2).
I am resolving IPv4 addresses, i am not using C-Ares, when i use numeric ip
addresses, it works. It works also with "localhost".
I'd say that if curl is using the very same lib as your app does, and curl
works but your app doesn't, it indicates that your app is doing something bad
that destroys for libcurl. I can't really tell what though since it sounds
very odd to me. Have you verified that your program is clean memory-wise with
valgrind or similar?

If you just build a sample from the libcurl examples dir and link that against
your libcurl, does that produce a working app?
--
/ daniel.haxx.se
Loading...