TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resolver sortlist

On Tue, 9 Mar 1999, Dan Mack wrote:
> "Mark A. Bentley" wrote:
> > Has anyone been able to get the sortlist option in /etc/resolv.conf to work
> > as documented in resolver(5) to work with RedHat 5.2?
> > 
> > It works fine with our Slackware 3.5 (libc5) systems, but so far I've been
> > unable to get it to work with RedHat 5.2 (glibc2).
> > 
> This works for us on stock RedHat 5.2:
>  % uname -a
>  Linux 2.2.0 #1 SMP Tue Jan 26 16:36:48 CST 1999
> i686 unknown
>  % cat /etc/resolv.conf
>  search
>  nameserver a.b.c.d
>  nameserver x.y.z.a
>  nameserver l.m.n.o
>  % ping dist.engr
>  (tigger-e194) ~ # ping dist.engr
>  PING ( 56 data bytes
>  64 bytes from icmp_seq=0 ttl=249 time=61.1 ms
>  64 bytes from icmp_seq=1 ttl=249 time=58.8 ms
> so, it used the second item in the search list.  Is this what you mean?

Not quite...there is actually an option "sortlist".  Here's an example
from a machine that is on the network:


We've just changed augustus and caesar (among others) so that their DNS
entries have multiple addresses.  See:

nslookup augustus ...



The sortlist option should give preferance to the particular network
listed.  In the example above the resolver should always return the IP for
the 229 interface to a machine doing an gethostbyname with the specified

This works on SunOS, IRIX, Slackware (libc5-based), and AIX.  But I can't
get our RedHat 5.2 machines to work.  When a RedHat 5.2 machine does a
gethostbyname, it will return an IP in round-robin fashion, and ignore the

I'm pretty sure it's a glibc2 issue...I've been looking through the source
to glibc-2.0.6 and I did find the "sortlist" option in resolv/res_init.c so
I know it is supported...just can't figure out why it's not working...Argh.


Mark A Bentley                  Email:
Systems Staff, CSci Dept
University of Minnesota         URL: