Strange problem: name resolution in perl > 5.8.2 doesn't work.

From: Bertels, Frank (fbertels@ixis-cib.com)
Date: Mon May 02 2005 - 10:56:40 EDT


Hi, all

I have the following problem:

If I try to ping a host from commandline, it's working.

If I try to use perl with the appropriate perl module, it didn't work.

Here's an example:

root@toronto:/tmp(605) > cat ping.pl

#!/usr/local/bin/perl -w

use strict;

use Net::Ping;

my $name = shift ;

if ( ! pingecho($name) ) {

       print "Can't ping $name \n";

}

else

{

       print "Ping $name OK\n";

};

root@toronto:/tmp(606) > ./ping.pl mcff2

Can't ping mcff2

My /etc/nsswitch.conf has the line:

hosts: files nis dns

AND VERY STRANGE is that if I add the hostname + ip to /etc/hosts, then
it's working. And if I add an entry to the DNS server, it's working,
too.

It seems that perl has a problem to resolve the ip if it's coming from
NIS.

My workstation is an Ultra 1 running Solaris 9 with all the patches
which are available (managed be Patchmanager Pro). The perl modules are
the precompiled versions from sunsite.

The perl version is 5.8.3. And with another Solaris 9 station with perl
5.8.5 I have the same problem. And with perl 5.8.0 it was ok, but I have
to upgrade because of other issues.

And I tested several other network perl modules like snmp and telnet.
All of them have the same problem. So it's no problem of the
ping-package.

And not to forget: There are no problems concerning my network, my NIS
installation and my Solaris stations are properly installed.

Does anybody have an idea what's wrong???

Bye

_________________________________________________

Frank Bertels

IXIS Corporate and Investment Bank

Im Trutz 55

60322 Frankfurt

Tel.: +49-69-97153-310

Fax: +49-69-97153-108

_________________________________________________

--------------------------------------------------------

This message and any attachments are confidential and intended solely for the
addressees, it may contain confidential and/or privileged information. Any use
not in accord with its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. If you receive this message
in error, please delete it and immediately notify the sender. Neither IXIS CIB
nor IXIS Corporate & Investment Bank shall be liable for the message if
altered, changed or falsified.
--------------------------------------------------------
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:38 EDT