DNS's a range of ip addresses.
Saves the nameservers returned to a file.
Multi-threaded to increase speed.
Not much of a purpose, I was bored.
You'll need Parallel::ForkManager.
#!/usr/bin/perl
use Parallel::ForkManager;
use strict;
use warnings;
my $one = 0; my $two = 0; my $three = 0; my $four = 0; my $sip = "0.0.0.0";
my $pm = new Parallel::ForkManager(100);
while($sip ne "255.255.255.255") {
$one++;
if ($one eq 256) { $one = 0; $two++; }
if ($two eq 256) { $two = 0; $three++; }
if ($three eq 256) { $three = 0; $four++; }
if ($four > 255) { $sip = "255.255.255.255"; }
my $pid = $pm->start and next;
$sip = "$four.$three.$two.$one";
print "Looking up: $sip\n";
chomp(my $host = `host $sip`);
if($host =~ /domain name pointer(.*)/) {
my $dnsd = $1;
print "$sip = $dnsd\n";
`echo "$dnsd" >>dnsout.log`;
}
$pm->finish;
}
print "Finished.\n";