1package Net::DNS::Check::Test::soa_master_in_ns; 2 3use strict; 4use vars qw(@ISA $VERSION); 5 6@ISA = qw(Net::DNS::Check::Test); 7 8 9sub new { 10 my ($class) = shift; 11 12 my ($self) = bless {}, $class; 13 14 if ( @_ ) { 15 $self->_process_args(@_); 16 } 17 18 $self->test(); 19 20 return $self; 21} 22 23 24sub test() 25{ 26 my ($self) = shift; 27 28 return unless ( $self->{nsauth} ); 29 30 my $test_status = 1; 31 my $test_detail = {}; 32 33 foreach my $nsquery ( @{$self->{nsquery}} ) { 34 my $found = 0; 35 my $ns_name = $nsquery->ns_name(); 36 foreach my $ns ( $nsquery->ns_list() ) { 37 if ( $nsquery->soa_mname() eq $ns ) { 38 $found = 1; 39 last; 40 } 41 } 42 43 $test_detail->{$ns_name}->{desc} = $nsquery->soa_mname() . " (NS " . join(' ', sort $nsquery->ns_list ) . ")"; 44 45 if ( $found ) { 46 $test_detail->{$ns_name}->{status} = 1; 47 } else { 48 $test_status = 0; 49 $test_detail->{$ns_name}->{status} = 0; 50 } 51 } 52 53 $self->{test_status} = $test_status; 54 $self->{test_detail} = $test_detail; 55 56 return $test_status; 57} 58 591; 60 61__END__ 62 63=head1 NAME 64 65Net::DNS::Check::Test::soa_master_in_ns - Check if the NS RR exists for the master nameserver specified in the SOA RR 66 67=head1 SYNOPSIS 68 69C<use Net::DNS::Check::Test::soa_master_in_ns>; 70 71=head1 DESCRIPTION 72 73Check if the NS RR exists for the master nameserver specified in the SOA RR. 74 75=head1 METHODS 76 77=head1 COPYRIGHT 78 79Copyright (c) 2005 Lorenzo Luconi Trombacchi - IIT-CNR 80 81All rights reserved. This program is free software; you may redistribute 82it and/or modify it under the same terms as Perl itself. 83 84=head1 SEE ALSO 85 86L<perl(1)> 87 88=cut 89 90