1package Net::DNS::Check::Test::host_not_cname; 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 24 25sub test() { 26 my ($self) = shift; 27 28 my $test_status = 1; 29 my @host_array; 30 my $test_detail = {}; 31 32 33 foreach my $nsquery ( @{$self->{nsquery}} ) { 34 foreach my $host ( $nsquery->hostslist()->get_list() ) { 35 push ( @host_array, $nsquery->hostslist()->get_host($host) ); 36 } 37 } 38 39 foreach my $host ( $self->{hostslist}->get_list() ) { 40 push ( @host_array, $self->{hostslist}->get_host($host) ); 41 } 42 43 44 45 foreach my $host ( @host_array ) { 46 47 my $hostname = $host->get_hostname(); 48 next if ( exists $test_detail->{$hostname} ); 49 50 $test_detail->{$hostname}->{desc} = $hostname; 51 if ( $host->get_cname() ) { 52 $test_detail->{$hostname}->{status} = 0; 53 $test_status = 0; 54 } else { 55 $test_detail->{$hostname}->{status} = 1; 56 } 57 58 } 59 60 $self->{test_status} = $test_status; 61 $self->{test_detail} = $test_detail; 62 63 return $test_status; 64} 65 661; 67 68 69__END__ 70 71=head1 NAME 72 73Net::DNS::Check::Test::host_not_cname - Check if the hosts found are CNAME or not 74 75=head1 SYNOPSIS 76 77C<use Net::DNS::Check::Test::host_not_cname>; 78 79=head1 DESCRIPTION 80 81Check if the hosts found are CNAME or not. 82 83=head1 METHODS 84 85=head1 COPYRIGHT 86 87Copyright (c) 2005 Lorenzo Luconi Trombacchi - IIT-CNR 88 89All rights reserved. This program is free software; you may redistribute 90it and/or modify it under the same terms as Perl itself. 91 92=head1 SEE ALSO 93 94L<perl(1)> 95 96=cut 97 98