Subject: lib/4684: resolver does not sort addresses
To: None <gnats-bugs@gnats.netbsd.org>
From: Kimmo Suominen <kim@lce.hut.fi>
List: netbsd-bugs
Date: 12/14/1997 12:54:16
>Number:         4684
>Category:       lib
>Synopsis:       resolver does not sort addresses
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 14 03:05:03 1997
>Last-Modified:
>Originator:     Kimmo Suominen
>Organization:
Kimmo Suominen
>Release:        1.3A, 1.2D, others
>Environment:
System: NetBSD styx.lce.hut.fi 1.3A NetBSD 1.3A (BEOWULF) #0: Fri Oct 24 04:25:55 EDT 1997 kim@borken.nyc.deshaw.com:/tmp_mnt/src/NetBSD/cvsroot/src/sys/arch/i386/compile/BEOWULF i386


>Description:
The resolver library does not sort IP addresses.  The standard BIND
resolver (at least since 4.8.3) will return an address on the local
network before other addresses.  It also has the sortlist directive
for resolv.conf, which is also documented in the NetBSD manual page
for resolv.conf.  However, on NetBSD the sortlist seems to be just
ignored.
>How-To-Repeat:
For a host with multiple IP addresses use the host-command from the
BIND distribution (linked with the BIND resolver library, not the
NetBSD one), e.g. "host buster.gw.net".  You will get the local IP
address first if you are resolving on one of the networks that this
machine is on.

Then try using telnet to that host, and you will see that you get
the normal round robin behaviour for the IP addresses.
>Fix:
A workaround is to use the BIND resolver library, but then it will
lack support for "files" and "nis".

I have no real fix to offer.  I suspect the ordering is lost in the
NetBSD interface to multiple databases.
>Audit-Trail:
>Unformatted: