TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:4623] Re: resolver sortlist
On Tue, 9 Mar 1999, Sandipan Panigrahi wrote:
> Isn't the sortlist just for sorting the entries ? From what
> I understand it only sorts the entries returned by a gethostbyname()
> in the order of the sortlist.
>
Yes, that's right.
> If you change your sortlist to 128.101.230.0/255.255.0.0,
> you will end up with the 128.101.230.70 as the first entry in the
> addresses. But you will still have the remaining addresses returned
> to it. It does not specify that only the 128.101.230.70 will be
> returned.
That is exactly right! The problem is, I can't get RedHat 5.2 machines to
behave this way. Even with the sortlist, the resolver still returns the
list of IPs unsorted...each successive call returns a different IP in the
front of the list.
> If you are only using nslookup to test to see if only
> one address is returned it could be that nslookup is broke in
> one or the other OS's. You could try testing by writing script
> to do a gethostbyname() and see how many entries are returned in
> each OS and the order in which they are returned.
>
I've been using various utilities like ping and telnet, which use
gethostbyname() to resolve names. I'll write a little perl script
and C program to call gethostbyname() and see what I get...
--Mark
> Mark A. Bentley wrote:
> >
> > 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/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tclug-list-unsubscribe@listserv.real-time.com
> > For additional commands, e-mail: tclug-list-help@listserv.real-time.com
> > Try our website: http://tclug.real-time.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@listserv.real-time.com
> For additional commands, e-mail: tclug-list-help@listserv.real-time.com
> Try our website: http://tclug.real-time.com
>
==========================================================================
Mark A Bentley Email: bentlema@cs.umn.edu
Systems Staff, CSci Dept
University of Minnesota URL: http://www.cs.umn.edu/~bentlema/