cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURLE_COULDNT_RESOLVE_HOST using libcurl easy interface

From: Dave Galloway <dgalloway_at_rx30.com>
Date: Wed, 19 Dec 2012 16:10:46 -0500

Date: Wed, 19 Dec 2012 11:24:36 +0100 (CET)
From: Daniel Stenberg <daniel_at_haxx.se>
To: libcurl development <curl-library_at_cool.haxx.se>
Subject: Re: CURLE_COULDNT_RESOLVE_HOST using libcurl easy interface
        on Linux
Message-ID: <alpine.DEB.2.00.1212191121390.9615_at_tvnag.unkk.fr>
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

On Tue, 18 Dec 2012, Dave Galloway wrote:

> The code below appears to work fine on Windows, I get the files I
> need. On Linux I am getting CURLE_COULDNT_RESOLVE_HOST. Using curl
> from the command line I can get the files in Linux and Windows, I can ping google.com, etc.
> from the command line in Linux and Windows.

Clearly some kind of name resolving issue. Possibly you experience some kind of bug in that libcurl version. It doesn't make any bells ring in my head though, I can't recall any particular specific problem in the past that would cause something like that. Then again my memory isn't always as good as it should be...

-- 
  / daniel.haxx.se
-------
I must be losing it because I can't seem to see the problem. I have cut down my test program to a bare minimum.
I have tried a newer version of libcurl, 7.21.4 instead of 7.19.6, that I had locally.
If I call curl_easy_setopt(curl, CURLOPT_URL, "google.com") after initializations and such and then curl_easy_perform(curl) it fails.
If I call curl_easy_setopt(curl, CURLOPT_URL, "74.125.140.101") it works.
The failure is on CentOS 5.4. Works fine both ways on the older Red Hat box and my Win 7 box.
At the getaddrinfo level in curl_addrinfo.c I am getting a -2 (NONAME) error which bubbles back up and eventually returns the CURLE_COULDNT_RESOLVE_HOST error.
I can ping google.com and 74.125.140.101 from the command line on all systems with no problem.
Any good ideas? Next up is to build the latest libcurl.
thanks, Dave
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-12-19