cURL / Mailing Lists / curl-library / Single Mail


round-robin DNS crap

From: Daniel Stenberg <>
Date: Fri, 13 Jul 2007 10:30:58 +0200 (CEST)


I talked with 'hawk' on IRC (#curl on the other day and the
subject of libcurl's using of getaddrinfo to resolve names and how the result
from that function is _not_ random enough to be fine when used against
round-robin DNS entries was brought back to life.

This is no news, I posted to this list about this issue back in november 2005

and to the glibc devel list:

... but as you can see the latter got no replies at all, and searching the net
reveals many other projects with the exact same problem. They all seem to
refer to the RFC 3484's described way to returned the list in some kind of
prefered/sorted order and obviously /etc/gai.conf can be edited to change how
getaddrinfo behaves.

Still, I believe we should consider our own "randomizer" of the getaddrinfo()
results so that libcurl will treat round-robin DNS entries better.

I found one approach posted on the URL below, which is a patch for wget from
April 2006:

I have not evaluated how good this particular implementation is, but we could
very likely at least use it as inspiration.

Thoughts on this?

  Commercial curl and libcurl Technical Support:
Received on 2007-07-13