I want to say first off that I can't write perl at all. This script was given to me by "hads" at .
Its supposed to use the dig command to query a nameserver for all zones that are tied to a certain subnet. 204.20.203.x. The perl script replaces x with 1-255.
I'd like to modify the script to look at the last two octets instead of just the one. Like 204.20.203.1-255, 204.20.204.1-255 and so on.
Here's the script as I have it now. I really hate asking for this kind of help, but I really don't know the first thing about editing a perl script.
Anyway, 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;
}
}
Thanks!
Its supposed to use the dig command to query a nameserver for all zones that are tied to a certain subnet. 204.20.203.x. The perl script replaces x with 1-255.
I'd like to modify the script to look at the last two octets instead of just the one. Like 204.20.203.1-255, 204.20.204.1-255 and so on.
Here's the script as I have it now. I really hate asking for this kind of help, but I really don't know the first thing about editing a perl script.
Anyway, 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;
}
}
Thanks!