On  1 Feb, chesty wrote:
>  On Thu, Feb 01, 2001 at 09:27:49AM +1100, [EMAIL PROTECTED] wrote:
>  
> > and the strace showed that the slow host *does* read the file
> > /etc/host.conf first - it just doesn't seem to find the information it
> > wants there!  (Since the NIS stuff starts, afterwards.)
>  
>  If you aren't using nis, you may as well delete all references to it 
>  from nsswitch.conf.

Okay.  That made no difference.

>  192.168.1.1     posh.localdomain        posh
>  127.0.0.1       localhost.localdomain   localhost       posh
>  
>  For no valid reason, other than it looks different to my /etc/hosts,
>  I'd try making that look like:
>  
>  127.0.0.1       localhost
>  192.168.1.1     posh.localdomain        posh

Okay.  No difference.

>  when you send traffic to a local interface, you are actually sending
>  traffic to the local loop interface. You can check for yourself by 
>  doing an ifconfig and then ping -c5  192.168.1.1, then do another 
>  ifconfig and compare RX and TX packets on eth0 and lo.

Yep.  Packets only transmitted on lo.

>  If you aren't running a name server, try moving /etc/resolv.conf
>  out of the way.

This was significant -

I moved it aside, and suddenly the machine that was slow to login
(while it did a DNS lookup) was fast.

I.e. coo and posh used to both have the same resolv.conf file, that
said:

search localdomain 
nameserver 203.15.68.3
nameserver 203.26.10.25         
nameserver 203.26.10.19         

(for my ISP's nameservers).  And of course posh could swiftly login to
coo but coo had to wait for a DNS timeout to slogin to posh.

Moving resolv.conf aside just on coo "fixed" this.  (Don't know why
this shouldn't be true for posh too - except for the next point.)

But coo is setup to use posh to get to the internet if posh is
connected at the time.  (A friend set this up for me.)

I bet this is the key point, isn't it?

Anyway, isn't there a problem with moving aside resolv.conf?  Namely,
that without a resolv.conf, coo won't know what nameserver to talk to to
resolve domain names?

> > If I want to modify the source to do some printf()s to trace what's
> > happening for the reading of the host.conf file - what library should I
> > be modifying?  What provides the functionality for reading host.conf?
>  
>  libresolv.so.2 ?
>  
>  grep -l /etc/hosts /lib/*
>  Basically you want libc6 sources.
>  (Do you really want to hack libc6?)

Not if I can avoid it!

>  Theres also a ltrace command that traces library calls.

Thanks.  That was interesting.  Looks like it stops for 2 minutes in
getaddrinfo(), before it eventually returns and everything proceeds
normally.

But I did another strace and looked at the output more carefully.

That seems to me to show that coo correctly gets the IP address of posh
from the /etc/hosts, but then sends some sort of IP packet down a socket
that includes the string "posh" and :localdomain", which seems to be
directed at each of the nameservers listed in resolv.conf.  Each one
fails after a short period, then it seems to try again.

This may account for the delay.  I.e. it's not really a DNS lookup at
all.  It's trying to validate the names (against spoofing or something?)

Is the system trying to talk to a nameserver to verify that posh and
localdomain are host and domain names that can be trusted?

BTW, is this significant?  On both hosts, this is what I get from these
commands:

        # gwhich domain
        /bin/dnsdomainname
        /bin/domainname
        /bin/nisdomainname
        /bin/ypdomainname
        # /bin/dnsdomainname
        localdomain
        # /bin/domainname

        # /bin/nisdomainname

        # /bin/ypdomainname


>  Do you have the same version libc6 package installed on both boxes?

Yep.

>  rpm -qa (from memory) on both boxes and diff them.

Yes, there are differences actually, I see.  Now I recall loading newer
versions of Gnome on "posh".  So it has a package called
caching-nameserver-6.2-2 that coo doesn't have at all, nss_ldap-105-1
and ypserv-1.3.9-3 likewise, but nothing else that looks even vaguely
relevant. 

>  Basically, I have no idea what the problem is :)

You've been really helpful, even if I am very sluggish to return to
this problem.  (I must admit my heart sinks each time I try to solve it.
Lots of blind alleys to chase down.)

luke





-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to