1package Net::DNS::Check::Test::ns_vs_delegated;
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	if ( $self->{nsauth} ) {
34		my $nsauth = lc(join('|', sort @{$self->{nsauth} }));
35
36    	foreach my $nsquery ( @{$self->{nsquery}} ) {
37        	my $nslist = lc(join('|', sort $nsquery->ns_list ));
38			my $ns_name = $nsquery->ns_name();
39
40			$test_detail->{$ns_name}->{desc} 	= "NS " . join(' ', sort $nsquery->ns_list );
41			if ($nsauth ne $nslist) {
42				$test_status = 0;
43				$test_detail->{$ns_name}->{status} 	= 0;
44			}
45			else {
46				$test_detail->{$ns_name}->{status} 	= 1;
47			}
48		}
49	} else {
50		# Error
51	}
52
53
54	$self->{test_status} = $test_status;
55	$self->{test_detail} = $test_detail;
56
57	return $test_status;
58}
59
601;
61
62__END__
63
64=head1 NAME
65
66Net::DNS::Check::Test::ns_vs_delegated - Compare the NS RR found with the effectively delegated nameservers (NS RR in the parent zone of the domain name being checked)
67
68=head1 SYNOPSIS
69
70C<use Net::DNS::Check::Test::ns_vs_delegated>;
71
72=head1 DESCRIPTION
73
74Compare the NS RR found with the effectively delegated nameservers (NS RR in the parent zone of the domain name being checked)
75
76=head1 METHODS
77
78=head1 COPYRIGHT
79
80Copyright (c) 2005 Lorenzo Luconi Trombacchi  - IIT-CNR
81
82All rights reserved.  This program is free software; you may redistribute
83it and/or modify it under the same terms as Perl itself.
84
85=head1 SEE ALSO
86
87L<perl(1)>
88
89=cut
90
91