sgt_b
11-06-2002, 05:51 PM
I have a script that was given to me that queries a nameserver for zones connected with IP addresses. As of right now it uses a variable to scan the last octet of an IP address (1-255). I'd like to be able to do the last 2 octets. I'm sure the script would explain things better than I could.
For the record I have no idea how to write or even modify perl scripts, so any help would be greatly appreciated.
Here's the script:
-----------------------------------
#!/usr/bin/perl
#
use strict;
my $i;
my $out;
my $subnet = "64.4.13";
for ($i = 1; $i < 255; $i++) {
$out = `dig -x $subnet.$i +short`;
if (length($out) < 3) {
print "Addr Not found\n";
}
else {
print $out;
}
}
-----------------------------------
Again, thak you for any help, as this script would be a great help to me!
For the record I have no idea how to write or even modify perl scripts, so any help would be greatly appreciated.
Here's the script:
-----------------------------------
#!/usr/bin/perl
#
use strict;
my $i;
my $out;
my $subnet = "64.4.13";
for ($i = 1; $i < 255; $i++) {
$out = `dig -x $subnet.$i +short`;
if (length($out) < 3) {
print "Addr Not found\n";
}
else {
print $out;
}
}
-----------------------------------
Again, thak you for any help, as this script would be a great help to me!