cURL / Mailing Lists / curl-library / Single Mail


Re: DNS look up will always fail, if thread is started with network cable disconnected.

From: Ben Noordhuis <>
Date: Fri, 20 May 2011 14:02:51 +0200

On Fri, May 20, 2011 at 10:38, Henrik Heino <> wrote:
> I'm using libcurl with easy interface in a multithreaded program. The system
> is FreeBSD and libcurl version is 7.20. I have noticed strange problem in
> the following case: I boot computer without network cable connected. Then I
> start my program and it starts some threads. After some time, I fix the
> network cable problem by connecting it.
> Now the computer has again connection to network, but all the threads that
> are started before connecting network cable, will keep failing with DNS look
> up. They might also fail with other network activity too, but currently I'm
> stuck with the phase where libcurl does DNS look up.
> Those threads, that are started after network cable is connected and system
> connects to network, are running just fine. So eventually, I'm in situation
> where half of threads keep complaining about failing DNS and others work as
> excepted.
> I also tried this in Linux with libcurl 7.21. The problem did not occure
> there, so this may be FreeBSD-problem. If you want to test this by yourself,
> the code of simple test program can be found here:
> The same source can also be found
> from so if you like to look at it, you don't
> have to extract any packages.
> But anyway, do you have any idea what I'm doing wrong?

Henrik, does your FreeBSD libcurl use c-ares or libc as the resolver?
List admin:
Received on 2011-05-20