cURL / Mailing Lists / curl-library / Single Mail

curl-library

round-robin DNS crap

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

Hi

I talked with 'hawk' on IRC (#curl on irc.freenode.net) 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

         http://curl.haxx.se/mail/lib-2005-11/0008.html

and to the glibc devel list:

         http://sourceware.org/ml/libc-alpha/2005-11/msg00028.html

... 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:

         http://foo-projects.org/pipermail/lunar-dev/2006-April/005729.html

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: http://haxx.se/curl.html
Received on 2007-07-13