cURL / Mailing Lists / curl-library / Single Mail


Re: error (6) : name lookup timed out

From: Phil Blundell <>
Date: Fri, 05 Dec 2008 15:30:01 +0000

On Thu, 2008-12-04 at 14:12 -0800, Dan Fandrich wrote:
> I suppose a setopt option could be added to cause libcurl to automatically
> call res_init() after a failed DNS lookup and try the lookup again for those
> apps that don't mind a longer potential timeout in exchange for making the
> resolve work at all.

That seems like a reasonable idea. Or alternatively, one could arrange
for libcurl to check the mtime on /etc/resolv.conf just before it calls
gethostbyname(), and make an automatic call to res_init() if resolv.conf
has changed. The overhead of stat() should be pretty negligible
compared to the time it takes to do the DNS lookup itself, so I don't
think this would be much of a performance hit.

Received on 2008-12-08