It ends with the expected data, but it only goes once through the loop using 10.220.84.30. Any help or ideas? thx! : )
#!/usr/bin/perl use strict; use warnings; use Carp; use Net::DNS; use Data::Dumper; #print qq ( Host\tIP\tNS7Host\tNS7IP\tWRHost\tWRIP ); my %AoH = ( q(client_IP) => [ qw (10.220.84.30 10.220.84.51 10.220.84.52 10.220.84.54 10.220.84.55 10.220.84.56 10.220.84.57 10.220.84.58 10.220.84.59 10.220.84.60 10.220.84.61 10.220.84.62 10.220.84.64 10.220.84.65 10.220.84.70 10.220.84.71 10.220.84.72 10.220.84.73 10.220.84.74 10.220.84.80 10.220.84.81 10.220.84.82 10.220.84.98 10.220.84.99 10.220.84.100 10.220.84.101 10.8.239.102 10.8.239.103 10.8.239.104 10.8.239.105 10.220.84.112 10.220.84.122 10.220.84.123 10.220.84.124 10.220.84.210 10.220.84.213 10.220.84.218 10.220.84.220 10.220.84.225 10.220.84.226 10.220.84.227 10.220.84.228 10.220.84.237 10.220.84.231 10.8.239.232 10.220.84.233 10.220.84.234 10.8.239.238 10.8.239.254 204.193.39.221 204.193.39.222 204.193.39.223 10.15.254.220 147.204.64.1 204.79.199.2 194.39.138.2 147.204.96.8 194.39.134.5 204.193.38.235 204.193.32.128 10.240.60.32 10.240.60.40 204.193.32.137 10.240.60.34 10.240.60.36 10.240.60.38 10.240.60.43 10.240.60.44 10.240.60.41 10.240.60.42 204.193.32.224 192.168.3.3 161.244.156.53 161.244.156.54 161.244.155.158 161.244.154.140 161.244.154.141 161.244.156.183 161.244.156.135 161.244.156.174 161.244.156.103 161.244.156.178 161.244.157.191 161.244.157.190) ] ) ; #for my $key (keys %AoH) { #print $key,' => ',join "\n\t", sort @{$AoH{$key}},"\n"; # print "\n"; # print "\n\t", sort @{$AoH{$key}},"\n"; #} #print sort @{$AoH{$_}} for (keys %AoH); for my $key (keys %AoH) { for my $domain qw(ns7.xxx.com wrnadc02.xx.xxxxxx.com) { nsqry($domain, @{$AoH{$key}} ) ; } } sub nsqry { my $nssvr = shift @_ ; my $client = shift @_ ; my $res = Net::DNS::Resolver->new ( nameservers => [$nssvr], recurse => 1, ## do recursive lookups retry => 1, debug => 0, ) ; my $query = $res->search($client) ; if ($query) { for my $rr ($query->answer) { next unless ($rr->type eq "PTR"); ## skip record if not eq + PTR ## print $rr->ptrdname, "\n" ; } } else { warn "query failed: ", $res->errorstring, "\n" ; } }
In reply to loop ending b4 I want it to by mikejones
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |