Created
April 21, 2015 20:19
-
-
Save agramajo/8696ee0a69d26a65945c to your computer and use it in GitHub Desktop.
generate reverse zones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@nets = qw( | |
x.x.x | |
x.x.y | |
); | |
$zone = <<EOF; | |
\$TTL 1800 | |
@ IN SOA ns1.xxx.com.ar. root.xxx.com.ar. 2014111104 10800 3600 604800 1800 | |
@ IN NS ns1.xxx.com.ar. | |
@ IN NS webmail.xxx.com.ar. | |
EOF | |
open REV, ">db.rev.xxx.com.ar"; | |
print REV "$zone"; | |
foreach $rev (@nets) { | |
open F, ">db.$rev"; | |
print F "$zone"; | |
$ip = join('.', reverse split(/\./, $rev)); | |
$net = $ip; | |
$net =~ tr/./-/; | |
foreach $host (0..255) { | |
print F "$host 1800 IN PTR host-$host-$net.rev.xxx.com.ar.\n"; | |
print REV "host-$host-$net 1800 IN A $rev.$host\n"; | |
} | |
close F; | |
} | |
close REV; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment