cURL / Mailing Lists / curl-library / Single Mail


RE: curl with c-ares returns "(Could not contact DNS servers)"

From: David Cook <>
Date: Thu, 3 Feb 2011 21:22:02 +0000


Ok I looked into the c-ares library and could not find the 3 tests you are talking about. I noticed that there are several tests in curl-x/tests/data. Which ones are you referring to?

I can resolve names without c-ares. I can ping any domain names. Within curl, it also worked without c-ares using the realtek name resolution library. It's just not stable with the realtek library. Curl crashes and stay stuck often when resolving names. That's why I want to try c-ares.

Thanks a lot for your feedback. Would you have any other comments?

I'm trying to find the source of the problem in the meantime by going through the code.


> Date: Thu, 3 Feb 2011 12:24:15 -0800
> From:
> To:
> Subject: Re: curl with c-ares returns "(Could not contact DNS servers)"
> On Thu, Feb 03, 2011 at 08:28:17AM +0000, D C wrote:
> > Problem:
> >
> > My problem is that I get "Couldn't resolve host name" everytime curl returns.
> > Upon further inspection in c-ares, I get the error "(Could not contact DNS
> > servers)" from c-ares. Then, I noticed that in the function waitperform() (in
> > hostares.c), the bitmask returned by ares_getsock is 0x0, which means, that
> > there are no fds used by c-ares to return DNS results. That sounds strange.
> >
> > I verified that the file, /etc/resolv.conf is present with a valid nameserver
> > entry. I also verified that ares/curl can read it properly.
> >
> > Any idea of what happened? Do I have the right packages for my platform? Is
> > there a bug that we should fix?
> >
> > I would appreciate any help.
> Do the three c-ares test programs work on this platform? Can other programs on
> this system resolve hosts? Does curl work if recompiled to not use c-ares?
> >>> Dan
> -------------------------------------------------------------------
> List admin:
> Etiquette:

List admin:
Received on 2011-02-03