find_lamers.pl (2)
- This is a reasonably common problem, so I expect to see quite a lot of incorrectly configured nameservers.
- Easily extended to check for combined authoritative/client resolvers (Bad practice)
- and check for version (host -t txt -c ch version.bind ns1.foobar.net.nz)
- luckily the last two are becoming more uncommon
- also check for different lists handed out by authoritative servers and/or roots (extra/missing nameservers).
- Check the primary ns server listed in the SOA record is correct.
foreach my $rr ($packet->answer) {
if ($rr->{type} eq 'NS') {
my $ns = lc($rr->rdatastr);
$ns =~ s{ . \z }{}xms;
$data->{$domain}{$level}{answer}{$ns}{name} = $ns;
}
}
foreach my $rr ($packet->additional) {
if ($rr->{type} eq 'A') {
$data->{$domain}{$level}{answer}{lc($rr->name)}{ip4} = lc($rr->rdatastr);
$ns_ip = lc($rr->rdatastr);
}
elsif ($rr->{type} eq 'AAAA') {
$data->{$domain}{$level}{answer}{lc($rr->name)}{ip6} = lc($rr->rdatastr);
}
}