[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IP addresses sorted in reverse order

On Wed, May 31, 2006 at 11:28:44PM +0200, Matus UHLAR - fantomas wrote:

> Searching mailinglists, bug databases did not give me correct answer.
> Does glibc sorty/reorder IP addresses gotten from DNS?
> Is this fixed in any newer versions of glibc?

AFAIK there are no requirements about the order of addresses returned by
any NSS calls. In particular, the returned order does not need to match
the order in the underlying database (DNS in this case). Anything that
relies on the returned addresses having a specific order is just plainly

If you want to access resources in a controlled order, then you should
choose a method that was designed for this purpose, like SRV records.
There are not many software that supports SRV records out of the box so
it is quite likely that you have to modify the clients.

An other option would be to play with routing instead of the DNS to
direct your clients to the nearest server.


     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences

Reply to: