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 tigger-e194.cray.com 2.2.0 #1 SMP Tue Jan 26 16:36:48 CST 1999
> i686 unknown
> 
>  % cat /etc/resolv.conf
>  search cray.com sgi.com americas.sgi.com
>  nameserver a.b.c.d
>  nameserver x.y.z.a
>  nameserver l.m.n.o
> 
>  % ping dist.engr
>  (tigger-e194) ~ # ping dist.engr
>  PING dist.engr.sgi.com (192.26.80.118): 56 data bytes
>  64 bytes from 192.26.80.118: icmp_seq=0 ttl=249 time=61.1 ms
>  64 bytes from 192.26.80.118: 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 128.101.229.0 network:

	search cs.umn.edu umn.edu
	nameserver 128.101.229.71
	sortlist 128.101.229.0/255.255.255.0

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

nslookup augustus ...

     Server:  mail.cs.umn.edu
     Address:  128.101.229.71

     Name:    mail.cs.umn.edu
     Addresses:  128.101.229.71, 128.101.230.70, 160.94.239.171,
                 128.101.248.7 160.94.27.171, 160.94.8.171, 160.94.148.171,
                 160.94.149.70, 128.101.224.69 128.101.225.70,
                 160.94.227.171, 128.101.228.69
     Aliases:  augustus.cs.umn.edu

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

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

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

==========================================================================
Mark A Bentley                  Email:  bentlema@cs.umn.edu
Systems Staff, CSci Dept
University of Minnesota         URL:    http://www.cs.umn.edu/~bentlema/