Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #
- # Zone Transfer (C) Jakub Zoczek
- #
- use Net::Nslookup;
- use Net::DNS;
- my $z = Net::DNS::Resolver->new();
- my @ns = nslookup(type => "NS", domain => $ARGV[0]);
- foreach $i (@ns) {
- print "Checking ", $i, "... ";
- $z->nameservers($i);
- my @zone = $z->axfr($ARGV[0]);
- if(@zone) {
- print "OK!\n";
- foreach my $record (@zone) {
- $record->print;
- }
- last;
- }
- else {
- print "failed.\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement