Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use Geo::IP::PurePerl;
- if($#ARGV == -1)
- {
- exit;
- }
- my $gi = Geo::IP::PurePerl->open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD);
- my @record = $gi->get_city_record($ARGV[0]);
- print $ARGV[0]."\t\t#".@record[4].", ".@record[3].", ".@record[2].", ";
- my $gio = Geo::IP::PurePerl->open("/usr/local/share/GeoIP/GeoIPOrg.dat", GEOIP_STANDARD);
- my @orecord = $gio->org_by_name($ARGV[0]);
- print "@orecord\t";
- my $rdns = "";
- open(DIG, "dig -x ".$ARGV[0]." |");
- while(<DIG>)
- {
- $line = $_;
- if($line =~ /IN[[:space:]]+PTR[[:space:]]+(?<dns>.+)\./)
- {
- $rdns = $rdns."\t".$1;
- }
- }
- print "$rdns \n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement