2 # infobot :: Kevin Lenzo (c) 1997
4 # once again, thanks to Patrick Cole
10 use vars qw($waitedpid);
13 $SIG{CHLD} = \&REAPER; # loathe sysV
17 $SIG{CHLD} = \&REAPER;
21 my($match, $x, $y, $result);
24 if (!defined($pid = fork)) {
25 return "no luck, $who";
30 if ($in =~ /(\d+\.\d+\.\d+\.\d+)/) {
31 &status("DNS query by IP address: $in");
33 $y = pack('C4', split(/\./, $match));
34 $x = (gethostbyaddr($y, &AF_INET));
36 $result = $match." is ".$x unless ($x =~ /^\s*$/);
38 $result = "I can't seem to find that address in DNS";
41 &status("DNS query by name: $in");
42 $x = join('.',unpack('C4',(gethostbyname($in))[4]));
44 $result = $in." is ".$x;
46 $result = "I can\'t find that machine name";
50 if ($msgType eq 'public') {