--- loncom/lonnet/perl/lonnet.pm 2005/02/05 22:20:56 1.595 +++ loncom/lonnet/perl/lonnet.pm 2005/02/09 22:04:22 1.596 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.595 2005/02/05 22:20:56 albertel Exp $ +# $Id: lonnet.pm,v 1.596 2005/02/09 22:04:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,7 +35,7 @@ use HTTP::Headers; use HTTP::Date; # use Date::Parse; use vars -qw(%perlvar %hostname %homecache %badServerCache %spareid %hostdom +qw(%perlvar %hostname %homecache %badServerCache %iphost %spareid %hostdom %libserv %pr %prp %metacache %packagetab %titlecache %courseresversioncache %resversioncache %courselogs %accesshash %userrolehash $processmarker $dumpcount %coursedombuf %coursenumbuf %coursehombuf %coursedescrbuf %courseinstcodebuf %courseownerbuf %courseresdatacache @@ -5683,7 +5683,15 @@ BEGIN { next if ($configline =~ /^(\#|\s*$)/); chomp($configline); my ($id,$domain,$role,$name)=split(/:/,$configline); + $name=~s/\s^//g; if ($id && $domain && $role && $name) { + my $ip = gethostbyname($name); + if (length($ip) ne 4) { + &logthis("Skipping host $id name $name no IP $ip found\n"); + next; + } + $ip=inet_ntoa($ip); + push(@{$iphost{$ip}},$id); $hostname{$id}=$name; $hostdom{$id}=$domain; if ($role eq 'library') { $libserv{$id}=$name; }