Bug 144373 - sortlist in resolv.conf doesn't work
sortlist in resolv.conf doesn't work
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2005-01-06 11:11 EST by D. Boyter
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-01-07 13:56:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description D. Boyter 2005-01-06 11:11:01 EST
Description of problem:
I am running an ethernet eth0 configured with an aliase eth0:0, I have
several subnets.  I have my name server configured to return results
in a particular order.  Whenever I use  telnet or ssh or anything else
that used gethostbyname, it tries to use the wrong ip address first. 
It tries to use any ip address that may be associated with eth0:0
first.  I tried to use sortlist to sort the results of the query but
to no avail.  If I reconfigure the box and remove alias eth0:0 then
then telnet and ssh try the ip addresses in the order that is placed
by my name server.  Everything ran fine under Fedora Core 1.

Version-Release number of selected component (if applicable):

How reproducible:

Very reproducable

Steps to Reproduce:
1.  Configure two boxes.  configure each box with eth0 and eth0:0
2.  Configure eth0 on both boxes with ip addresses on one subnet, and
eth0:0 on both boxes with ip addresses on another subnet.
3.  Configure a name server to deliver the addresses on box 2 eth0
first, and the address on box 2 eth0:0 second when say,
example.redhat.com is looked up.
4.   Telnet to box 2 from box 1 and it will try the address on eth0:0
on box 2 first instead of eth0 on box 2.  Even if you use sortlist it
will insist on using the address on eth0:0 first.
Actual results:

Expected results:

Additional info:
Comment 1 Jakub Jelinek 2005-01-07 10:26:16 EST
AFAIK sortlist only affects res_gethostbyname* and telnet most likely uses
Not sure if we want to use it for getaddrinfo and libc gethostby*.
Comment 2 D. Boyter 2005-01-07 10:54:25 EST
It would be nice if there were an option to turn sorting off though.  My 
queries always came through unsorted in Fedora core 1, but in fedora core 3 
they are sorted, and this creates problems for me. 
Comment 3 Ulrich Drepper 2005-01-07 13:56:43 EST
getaddrinfo sorts addresses according to RFC 3484.  That's what is supposed to
happen and we'll not grow a feature to disable this since any such option will
have disastrous results in real world (if addresses outside the local network
are used).  If you want a specific order, create the subnet the way that it has
this order according to RFC 3484.

Note You need to log in before you can comment on or make changes to this bug.