line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Zonemaster::Engine::Test::Zone; |
2
|
|
|
|
|
|
|
|
3
|
26
|
|
|
26
|
|
9848
|
use version; our $VERSION = version->declare("v1.0.3"); |
|
26
|
|
|
|
|
56
|
|
|
26
|
|
|
|
|
151
|
|
4
|
|
|
|
|
|
|
|
5
|
26
|
|
|
26
|
|
1959
|
use strict; |
|
26
|
|
|
|
|
54
|
|
|
26
|
|
|
|
|
456
|
|
6
|
26
|
|
|
26
|
|
111
|
use warnings; |
|
26
|
|
|
|
|
47
|
|
|
26
|
|
|
|
|
531
|
|
7
|
|
|
|
|
|
|
|
8
|
26
|
|
|
26
|
|
379
|
use 5.014002; |
|
26
|
|
|
|
|
82
|
|
9
|
|
|
|
|
|
|
|
10
|
26
|
|
|
26
|
|
135
|
use Zonemaster::Engine; |
|
26
|
|
|
|
|
52
|
|
|
26
|
|
|
|
|
510
|
|
11
|
26
|
|
|
26
|
|
123
|
use Zonemaster::Engine::Util; |
|
26
|
|
|
|
|
53
|
|
|
26
|
|
|
|
|
1419
|
|
12
|
26
|
|
|
26
|
|
139
|
use Zonemaster::Engine::Test::Address; |
|
26
|
|
|
|
|
73
|
|
|
26
|
|
|
|
|
513
|
|
13
|
26
|
|
|
26
|
|
127
|
use Zonemaster::Engine::TestMethods; |
|
26
|
|
|
|
|
50
|
|
|
26
|
|
|
|
|
573
|
|
14
|
26
|
|
|
26
|
|
123
|
use Zonemaster::Engine::Constants qw[:soa :ip]; |
|
26
|
|
|
|
|
52
|
|
|
26
|
|
|
|
|
3944
|
|
15
|
26
|
|
|
26
|
|
186
|
use List::MoreUtils qw[none]; |
|
26
|
|
|
|
|
51
|
|
|
26
|
|
|
|
|
174
|
|
16
|
|
|
|
|
|
|
|
17
|
26
|
|
|
26
|
|
14138
|
use Carp; |
|
26
|
|
|
|
|
56
|
|
|
26
|
|
|
|
|
54085
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
### |
20
|
|
|
|
|
|
|
### Entry Points |
21
|
|
|
|
|
|
|
### |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub all { |
24
|
7
|
|
|
7
|
1
|
16
|
my ( $class, $zone ) = @_; |
25
|
7
|
|
|
|
|
15
|
my @results; |
26
|
|
|
|
|
|
|
|
27
|
7
|
50
|
|
|
|
24
|
push @results, $class->zone01( $zone ) if Zonemaster::Engine->config->should_run( 'zone01' ); |
28
|
7
|
50
|
|
9
|
|
43
|
if ( none { $_->tag eq q{NO_RESPONSE_SOA_QUERY} } @results ) { |
|
9
|
|
|
|
|
249
|
|
29
|
|
|
|
|
|
|
|
30
|
7
|
50
|
|
|
|
24
|
push @results, $class->zone02( $zone ) if Zonemaster::Engine->config->should_run( 'zone02' ); |
31
|
7
|
50
|
|
|
|
28
|
push @results, $class->zone03( $zone ) if Zonemaster::Engine->config->should_run( 'zone03' ); |
32
|
7
|
50
|
|
|
|
27
|
push @results, $class->zone04( $zone ) if Zonemaster::Engine->config->should_run( 'zone04' ); |
33
|
7
|
50
|
|
|
|
28
|
push @results, $class->zone05( $zone ) if Zonemaster::Engine->config->should_run( 'zone05' ); |
34
|
7
|
50
|
|
|
|
27
|
push @results, $class->zone06( $zone ) if Zonemaster::Engine->config->should_run( 'zone06' ); |
35
|
7
|
50
|
|
48
|
|
56
|
if ( none { $_->tag eq q{MNAME_RECORD_DOES_NOT_EXIST} } @results ) { |
|
48
|
|
|
|
|
1233
|
|
36
|
7
|
50
|
|
|
|
27
|
push @results, $class->zone07( $zone ) if Zonemaster::Engine->config->should_run( 'zone07' ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
7
|
50
|
|
64
|
|
104
|
if ( none { $_->tag eq q{MNAME_RECORD_DOES_NOT_EXIST} } @results ) { |
|
64
|
|
|
|
|
1589
|
|
40
|
7
|
50
|
|
|
|
33
|
push @results, $class->zone08( $zone ) if Zonemaster::Engine->config->should_run( 'zone08' ); |
41
|
7
|
50
|
|
71
|
|
51
|
if ( none { $_->tag eq q{NO_RESPONSE_MX_QUERY} } @results ) { |
|
71
|
|
|
|
|
1794
|
|
42
|
7
|
50
|
|
|
|
27
|
push @results, $class->zone09( $zone ) if Zonemaster::Engine->config->should_run( 'zone09' ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
7
|
|
|
|
|
66
|
return @results; |
47
|
|
|
|
|
|
|
} ## end sub all |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
### |
50
|
|
|
|
|
|
|
### Metadata Exposure |
51
|
|
|
|
|
|
|
### |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub metadata { |
54
|
12
|
|
|
12
|
1
|
24
|
my ( $class ) = @_; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
return { |
57
|
12
|
|
|
|
|
191
|
zone01 => [ |
58
|
|
|
|
|
|
|
qw( |
59
|
|
|
|
|
|
|
MNAME_RECORD_DOES_NOT_EXIST |
60
|
|
|
|
|
|
|
MNAME_NOT_AUTHORITATIVE |
61
|
|
|
|
|
|
|
MNAME_NO_RESPONSE |
62
|
|
|
|
|
|
|
MNAME_NOT_IN_GLUE |
63
|
|
|
|
|
|
|
MNAME_IS_AUTHORITATIVE |
64
|
|
|
|
|
|
|
NO_RESPONSE_SOA_QUERY |
65
|
|
|
|
|
|
|
) |
66
|
|
|
|
|
|
|
], |
67
|
|
|
|
|
|
|
zone02 => [ |
68
|
|
|
|
|
|
|
qw( |
69
|
|
|
|
|
|
|
REFRESH_MINIMUM_VALUE_LOWER |
70
|
|
|
|
|
|
|
REFRESH_MINIMUM_VALUE_OK |
71
|
|
|
|
|
|
|
NO_RESPONSE_SOA_QUERY |
72
|
|
|
|
|
|
|
) |
73
|
|
|
|
|
|
|
], |
74
|
|
|
|
|
|
|
zone03 => [ |
75
|
|
|
|
|
|
|
qw( |
76
|
|
|
|
|
|
|
REFRESH_LOWER_THAN_RETRY |
77
|
|
|
|
|
|
|
REFRESH_HIGHER_THAN_RETRY |
78
|
|
|
|
|
|
|
NO_RESPONSE_SOA_QUERY |
79
|
|
|
|
|
|
|
) |
80
|
|
|
|
|
|
|
], |
81
|
|
|
|
|
|
|
zone04 => [ |
82
|
|
|
|
|
|
|
qw( |
83
|
|
|
|
|
|
|
RETRY_MINIMUM_VALUE_LOWER |
84
|
|
|
|
|
|
|
RETRY_MINIMUM_VALUE_OK |
85
|
|
|
|
|
|
|
NO_RESPONSE_SOA_QUERY |
86
|
|
|
|
|
|
|
) |
87
|
|
|
|
|
|
|
], |
88
|
|
|
|
|
|
|
zone05 => [ |
89
|
|
|
|
|
|
|
qw( |
90
|
|
|
|
|
|
|
EXPIRE_MINIMUM_VALUE_LOWER |
91
|
|
|
|
|
|
|
EXPIRE_LOWER_THAN_REFRESH |
92
|
|
|
|
|
|
|
EXPIRE_MINIMUM_VALUE_OK |
93
|
|
|
|
|
|
|
NO_RESPONSE_SOA_QUERY |
94
|
|
|
|
|
|
|
) |
95
|
|
|
|
|
|
|
], |
96
|
|
|
|
|
|
|
zone06 => [ |
97
|
|
|
|
|
|
|
qw( |
98
|
|
|
|
|
|
|
SOA_DEFAULT_TTL_MAXIMUM_VALUE_HIGHER |
99
|
|
|
|
|
|
|
SOA_DEFAULT_TTL_MAXIMUM_VALUE_LOWER |
100
|
|
|
|
|
|
|
SOA_DEFAULT_TTL_MAXIMUM_VALUE_OK |
101
|
|
|
|
|
|
|
NO_RESPONSE_SOA_QUERY |
102
|
|
|
|
|
|
|
) |
103
|
|
|
|
|
|
|
], |
104
|
|
|
|
|
|
|
zone07 => [ |
105
|
|
|
|
|
|
|
qw( |
106
|
|
|
|
|
|
|
MNAME_IS_CNAME |
107
|
|
|
|
|
|
|
MNAME_IS_NOT_CNAME |
108
|
|
|
|
|
|
|
NO_RESPONSE_SOA_QUERY |
109
|
|
|
|
|
|
|
MNAME_HAS_NO_ADDRESS |
110
|
|
|
|
|
|
|
) |
111
|
|
|
|
|
|
|
], |
112
|
|
|
|
|
|
|
zone08 => [ |
113
|
|
|
|
|
|
|
qw( |
114
|
|
|
|
|
|
|
MX_RECORD_IS_CNAME |
115
|
|
|
|
|
|
|
MX_RECORD_IS_NOT_CNAME |
116
|
|
|
|
|
|
|
NO_RESPONSE_MX_QUERY |
117
|
|
|
|
|
|
|
) |
118
|
|
|
|
|
|
|
], |
119
|
|
|
|
|
|
|
zone09 => [ |
120
|
|
|
|
|
|
|
qw( |
121
|
|
|
|
|
|
|
NO_MX_RECORD |
122
|
|
|
|
|
|
|
MX_RECORD_EXISTS |
123
|
|
|
|
|
|
|
NO_RESPONSE_MX_QUERY |
124
|
|
|
|
|
|
|
) |
125
|
|
|
|
|
|
|
], |
126
|
|
|
|
|
|
|
}; |
127
|
|
|
|
|
|
|
} ## end sub metadata |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub translation { |
130
|
|
|
|
|
|
|
return { |
131
|
1
|
|
|
1
|
1
|
20
|
'RETRY_MINIMUM_VALUE_LOWER' => |
132
|
|
|
|
|
|
|
'SOA \'retry\' value ({retry}) is less than the recommended one ({required_retry}).', |
133
|
|
|
|
|
|
|
'RETRY_MINIMUM_VALUE_OK' => |
134
|
|
|
|
|
|
|
'SOA \'retry\' value ({retry}) is more than the minimum recommended value ({required_retry}).', |
135
|
|
|
|
|
|
|
'MNAME_NO_RESPONSE' => 'SOA \'mname\' nameserver {ns}/{address} does not respond.', |
136
|
|
|
|
|
|
|
'MNAME_IS_CNAME' => 'SOA \'mname\' value ({mname}) refers to a NS which is an alias (CNAME).', |
137
|
|
|
|
|
|
|
'MNAME_IS_NOT_CNAME' => 'SOA \'mname\' value ({mname}) refers to a NS which is not an alias (CNAME).', |
138
|
|
|
|
|
|
|
'NO_MX_RECORD' => 'No target (MX, A or AAAA record) to deliver e-mail for the domain name.', |
139
|
|
|
|
|
|
|
'MX_RECORD_EXISTS' => 'Target ({info}) found to deliver e-mail for the domain name.', |
140
|
|
|
|
|
|
|
'REFRESH_MINIMUM_VALUE_LOWER' => |
141
|
|
|
|
|
|
|
'SOA \'refresh\' value ({refresh}) is less than the recommended one ({required_refresh}).', |
142
|
|
|
|
|
|
|
'REFRESH_MINIMUM_VALUE_OK' => |
143
|
|
|
|
|
|
|
'SOA \'refresh\' value ({refresh}) is higher than the minimum recommended value ({required_refresh}).', |
144
|
|
|
|
|
|
|
'EXPIRE_LOWER_THAN_REFRESH' => |
145
|
|
|
|
|
|
|
'SOA \'expire\' value ({expire}) is lower than the SOA \'refresh\' value ({refresh}).', |
146
|
|
|
|
|
|
|
'SOA_DEFAULT_TTL_MAXIMUM_VALUE_HIGHER' => |
147
|
|
|
|
|
|
|
'SOA \'minimum\' value ({minimum}) is higher than the recommended one ({highest_minimum}).', |
148
|
|
|
|
|
|
|
'SOA_DEFAULT_TTL_MAXIMUM_VALUE_LOWER' => |
149
|
|
|
|
|
|
|
'SOA \'minimum\' value ({minimum}) is less than the recommended one ({lowest_minimum}).', |
150
|
|
|
|
|
|
|
'SOA_DEFAULT_TTL_MAXIMUM_VALUE_OK' => |
151
|
|
|
|
|
|
|
'SOA \'minimum\' value ({minimum}) is between the recommended ones ({lowest_minimum}/{highest_minimum}).', |
152
|
|
|
|
|
|
|
'MNAME_NOT_AUTHORITATIVE' => |
153
|
|
|
|
|
|
|
'SOA \'mname\' nameserver {ns}/{address} is not authoritative for \'{zone}\' zone.', |
154
|
|
|
|
|
|
|
'MNAME_RECORD_DOES_NOT_EXIST' => 'SOA \'mname\' field does not exist', |
155
|
|
|
|
|
|
|
'EXPIRE_MINIMUM_VALUE_LOWER' => |
156
|
|
|
|
|
|
|
'SOA \'expire\' value ({expire}) is less than the recommended one ({required_expire}).', |
157
|
|
|
|
|
|
|
'MNAME_NOT_IN_GLUE' => |
158
|
|
|
|
|
|
|
'SOA \'mname\' nameserver ({mname}) is not listed in "parent" NS records for tested zone ({ns}).', |
159
|
|
|
|
|
|
|
'REFRESH_LOWER_THAN_RETRY' => |
160
|
|
|
|
|
|
|
'SOA \'refresh\' value ({refresh}) is lower than the SOA \'retry\' value ({retry}).', |
161
|
|
|
|
|
|
|
'REFRESH_HIGHER_THAN_RETRY' => |
162
|
|
|
|
|
|
|
'SOA \'refresh\' value ({refresh}) is higher than the SOA \'retry\' value ({retry}).', |
163
|
|
|
|
|
|
|
'MX_RECORD_IS_CNAME' => 'MX record for the domain is pointing to a CNAME.', |
164
|
|
|
|
|
|
|
'MX_RECORD_IS_NOT_CNAME' => 'MX record for the domain is not pointing to a CNAME.', |
165
|
|
|
|
|
|
|
'MNAME_IS_AUTHORITATIVE' => 'SOA \'mname\' nameserver ({mname}) is authoritative for \'{zone}\' zone.', |
166
|
|
|
|
|
|
|
'NO_RESPONSE_SOA_QUERY' => 'No response from nameserver(s) on SOA queries.', |
167
|
|
|
|
|
|
|
'NO_RESPONSE_MX_QUERY' => 'No response from nameserver(s) on MX queries.', |
168
|
|
|
|
|
|
|
'MNAME_HAS_NO_ADDRESS' => 'No IP address found for SOA \'mname\' nameserver ({mname}).', |
169
|
|
|
|
|
|
|
'EXPIRE_MINIMUM_VALUE_OK' => |
170
|
|
|
|
|
|
|
'SOA \'expire\' value ({expire}) is higher than the minimum recommended value ({required_expire}) and not lower than the \'refresh\' value ({refresh}).', |
171
|
|
|
|
|
|
|
}; |
172
|
|
|
|
|
|
|
} ## end sub translation |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub version { |
175
|
17
|
|
|
17
|
1
|
164
|
return "$Zonemaster::Engine::Test::Zone::VERSION"; |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub zone01 { |
179
|
10
|
|
|
10
|
1
|
30
|
my ( $class, $zone ) = @_; |
180
|
10
|
|
|
|
|
18
|
my @results; |
181
|
|
|
|
|
|
|
|
182
|
10
|
|
|
|
|
255
|
my $p = _retrieve_record_from_zone( $zone, $zone->name, q{SOA} ); |
183
|
|
|
|
|
|
|
|
184
|
10
|
100
|
66
|
|
|
188
|
if ( $p and my ( $soa ) = $p->get_records( q{SOA}, q{answer} ) ) { |
185
|
9
|
|
|
|
|
95
|
my $soa_mname = $soa->mname; |
186
|
9
|
|
|
|
|
54
|
$soa_mname =~ s/[.]\z//smx; |
187
|
9
|
100
|
|
|
|
27
|
if ( not $soa_mname ) { |
188
|
1
|
|
|
|
|
5
|
push @results, info( MNAME_RECORD_DOES_NOT_EXIST => {} ); |
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
else { |
191
|
8
|
|
|
|
|
49
|
foreach my $ip_address ( Zonemaster::Engine::Recursor->get_addresses_for( $soa_mname ) ) { |
192
|
|
|
|
|
|
|
|
193
|
8
|
|
|
|
|
48
|
my $ns = Zonemaster::Engine::Nameserver->new( { name => $soa_mname, address => $ip_address->short } ); |
194
|
|
|
|
|
|
|
|
195
|
8
|
100
|
|
|
|
49
|
if ( _is_ip_version_disabled( $ns ) ) { |
196
|
1
|
|
|
|
|
3
|
next; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
7
|
|
|
|
|
201
|
my $p_soa = $ns->query( $zone->name, q{SOA} ); |
200
|
7
|
100
|
66
|
|
|
55
|
if ( $p_soa and $p_soa->rcode eq q{NOERROR} ) { |
201
|
6
|
100
|
|
|
|
121
|
if ( not $p_soa->aa ) { |
202
|
1
|
|
|
|
|
15
|
push @results, |
203
|
|
|
|
|
|
|
info( |
204
|
|
|
|
|
|
|
MNAME_NOT_AUTHORITATIVE => { |
205
|
|
|
|
|
|
|
ns => $soa_mname, |
206
|
|
|
|
|
|
|
address => $ip_address->short, |
207
|
|
|
|
|
|
|
zone => $zone->name, |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
); |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
} |
212
|
|
|
|
|
|
|
else { |
213
|
1
|
|
|
|
|
4
|
push @results, |
214
|
|
|
|
|
|
|
info( |
215
|
|
|
|
|
|
|
MNAME_NO_RESPONSE => { |
216
|
|
|
|
|
|
|
ns => $soa_mname, |
217
|
|
|
|
|
|
|
address => $ip_address->short, |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
); |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
} ## end foreach my $ip_address ( Zonemaster::Engine::Recursor...) |
222
|
8
|
100
|
|
14
|
|
113
|
if ( none { $_ eq $soa_mname } @{ Zonemaster::Engine::TestMethods->method2( $zone ) } ) { |
|
14
|
|
|
|
|
56
|
|
|
8
|
|
|
|
|
50
|
|
223
|
|
|
|
|
|
|
push @results, |
224
|
|
|
|
|
|
|
info( |
225
|
|
|
|
|
|
|
MNAME_NOT_IN_GLUE => { |
226
|
|
|
|
|
|
|
mname => $soa_mname, |
227
|
4
|
|
|
|
|
11
|
ns => join( q{;}, @{ Zonemaster::Engine::TestMethods->method2( $zone ) } ), |
|
4
|
|
|
|
|
12
|
|
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
); |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
} ## end else [ if ( not $soa_mname ) ] |
232
|
9
|
100
|
|
|
|
63
|
if ( not scalar @results ) { |
233
|
4
|
|
|
|
|
98
|
push @results, |
234
|
|
|
|
|
|
|
info( |
235
|
|
|
|
|
|
|
MNAME_IS_AUTHORITATIVE => { |
236
|
|
|
|
|
|
|
mname => $soa_mname, |
237
|
|
|
|
|
|
|
zone => $zone->name, |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
); |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
} ## end if ( $p and my ( $soa ...)) |
242
|
|
|
|
|
|
|
else { |
243
|
1
|
|
|
|
|
6
|
push @results, info( NO_RESPONSE_SOA_QUERY => {} ); |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
10
|
|
|
|
|
92
|
return @results; |
247
|
|
|
|
|
|
|
} ## end sub zone01 |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
sub zone02 { |
250
|
8
|
|
|
8
|
1
|
21
|
my ( $class, $zone ) = @_; |
251
|
8
|
|
|
|
|
16
|
my @results; |
252
|
|
|
|
|
|
|
|
253
|
8
|
|
|
|
|
193
|
my $p = _retrieve_record_from_zone( $zone, $zone->name, q{SOA} ); |
254
|
|
|
|
|
|
|
|
255
|
8
|
100
|
66
|
|
|
154
|
if ( $p and my ( $soa ) = $p->get_records( q{SOA}, q{answer} ) ) { |
256
|
7
|
|
|
|
|
30
|
my $soa_refresh = $soa->refresh; |
257
|
7
|
100
|
|
|
|
55
|
if ( $soa_refresh < $SOA_REFRESH_MINIMUM_VALUE ) { |
258
|
2
|
|
|
|
|
26
|
push @results, |
259
|
|
|
|
|
|
|
info( |
260
|
|
|
|
|
|
|
REFRESH_MINIMUM_VALUE_LOWER => { |
261
|
|
|
|
|
|
|
refresh => $soa_refresh, |
262
|
|
|
|
|
|
|
required_refresh => $SOA_REFRESH_MINIMUM_VALUE, |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
); |
265
|
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
else { |
267
|
5
|
|
|
|
|
42
|
push @results, |
268
|
|
|
|
|
|
|
info( |
269
|
|
|
|
|
|
|
REFRESH_MINIMUM_VALUE_OK => { |
270
|
|
|
|
|
|
|
refresh => $soa_refresh, |
271
|
|
|
|
|
|
|
required_refresh => $SOA_REFRESH_MINIMUM_VALUE, |
272
|
|
|
|
|
|
|
} |
273
|
|
|
|
|
|
|
); |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
} ## end if ( $p and my ( $soa ...)) |
276
|
|
|
|
|
|
|
else { |
277
|
1
|
|
|
|
|
4
|
push @results, info( NO_RESPONSE_SOA_QUERY => {} ); |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
8
|
|
|
|
|
49
|
return @results; |
281
|
|
|
|
|
|
|
} ## end sub zone02 |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
sub zone03 { |
284
|
8
|
|
|
8
|
1
|
26
|
my ( $class, $zone ) = @_; |
285
|
8
|
|
|
|
|
17
|
my @results; |
286
|
|
|
|
|
|
|
|
287
|
8
|
|
|
|
|
189
|
my $p = _retrieve_record_from_zone( $zone, $zone->name, q{SOA} ); |
288
|
|
|
|
|
|
|
|
289
|
8
|
100
|
66
|
|
|
123
|
if ( $p and my ( $soa ) = $p->get_records( q{SOA}, q{answer} ) ) { |
290
|
7
|
|
|
|
|
30
|
my $soa_retry = $soa->retry; |
291
|
7
|
|
|
|
|
23
|
my $soa_refresh = $soa->refresh; |
292
|
7
|
100
|
|
|
|
26
|
if ( $soa_retry >= $soa_refresh ) { |
293
|
3
|
|
|
|
|
17
|
push @results, |
294
|
|
|
|
|
|
|
info( |
295
|
|
|
|
|
|
|
REFRESH_LOWER_THAN_RETRY => { |
296
|
|
|
|
|
|
|
retry => $soa_retry, |
297
|
|
|
|
|
|
|
refresh => $soa_refresh, |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
); |
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
else { |
302
|
4
|
|
|
|
|
24
|
push @results, |
303
|
|
|
|
|
|
|
info( |
304
|
|
|
|
|
|
|
REFRESH_HIGHER_THAN_RETRY => { |
305
|
|
|
|
|
|
|
retry => $soa_retry, |
306
|
|
|
|
|
|
|
refresh => $soa_refresh, |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
); |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
} ## end if ( $p and my ( $soa ...)) |
311
|
|
|
|
|
|
|
else { |
312
|
1
|
|
|
|
|
5
|
push @results, info( NO_RESPONSE_SOA_QUERY => {} ); |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
8
|
|
|
|
|
273
|
return @results; |
316
|
|
|
|
|
|
|
} ## end sub zone03 |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
sub zone04 { |
319
|
8
|
|
|
8
|
1
|
26
|
my ( $class, $zone ) = @_; |
320
|
8
|
|
|
|
|
12
|
my @results; |
321
|
|
|
|
|
|
|
|
322
|
8
|
|
|
|
|
192
|
my $p = _retrieve_record_from_zone( $zone, $zone->name, q{SOA} ); |
323
|
|
|
|
|
|
|
|
324
|
8
|
100
|
66
|
|
|
126
|
if ( $p and my ( $soa ) = $p->get_records( q{SOA}, q{answer} ) ) { |
325
|
7
|
|
|
|
|
24
|
my $soa_retry = $soa->retry; |
326
|
7
|
100
|
|
|
|
37
|
if ( $soa_retry < $SOA_RETRY_MINIMUM_VALUE ) { |
327
|
1
|
|
|
|
|
9
|
push @results, |
328
|
|
|
|
|
|
|
info( |
329
|
|
|
|
|
|
|
RETRY_MINIMUM_VALUE_LOWER => { |
330
|
|
|
|
|
|
|
retry => $soa_retry, |
331
|
|
|
|
|
|
|
required_retry => $SOA_RETRY_MINIMUM_VALUE, |
332
|
|
|
|
|
|
|
} |
333
|
|
|
|
|
|
|
); |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
else { |
336
|
6
|
|
|
|
|
49
|
push @results, |
337
|
|
|
|
|
|
|
info( |
338
|
|
|
|
|
|
|
RETRY_MINIMUM_VALUE_OK => { |
339
|
|
|
|
|
|
|
retry => $soa_retry, |
340
|
|
|
|
|
|
|
required_retry => $SOA_RETRY_MINIMUM_VALUE, |
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
); |
343
|
|
|
|
|
|
|
} |
344
|
|
|
|
|
|
|
} ## end if ( $p and my ( $soa ...)) |
345
|
|
|
|
|
|
|
else { |
346
|
1
|
|
|
|
|
4
|
push @results, info( NO_RESPONSE_SOA_QUERY => {} ); |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
|
349
|
8
|
|
|
|
|
43
|
return @results; |
350
|
|
|
|
|
|
|
} ## end sub zone04 |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
sub zone05 { |
353
|
8
|
|
|
8
|
1
|
27
|
my ( $class, $zone ) = @_; |
354
|
8
|
|
|
|
|
14
|
my @results; |
355
|
|
|
|
|
|
|
|
356
|
8
|
|
|
|
|
252
|
my $p = _retrieve_record_from_zone( $zone, $zone->name, q{SOA} ); |
357
|
|
|
|
|
|
|
|
358
|
8
|
100
|
66
|
|
|
119
|
if ( $p and my ( $soa ) = $p->get_records( q{SOA}, q{answer} ) ) { |
359
|
7
|
|
|
|
|
30
|
my $soa_expire = $soa->expire; |
360
|
7
|
|
|
|
|
22
|
my $soa_refresh = $soa->refresh; |
361
|
7
|
100
|
|
|
|
34
|
if ( $soa_expire < $SOA_EXPIRE_MINIMUM_VALUE ) { |
362
|
4
|
|
|
|
|
35
|
push @results, |
363
|
|
|
|
|
|
|
info( |
364
|
|
|
|
|
|
|
EXPIRE_MINIMUM_VALUE_LOWER => { |
365
|
|
|
|
|
|
|
expire => $soa_expire, |
366
|
|
|
|
|
|
|
required_expire => $SOA_EXPIRE_MINIMUM_VALUE, |
367
|
|
|
|
|
|
|
} |
368
|
|
|
|
|
|
|
); |
369
|
|
|
|
|
|
|
} |
370
|
7
|
100
|
|
|
|
36
|
if ( $soa_expire < $soa_refresh ) { |
371
|
4
|
|
|
|
|
19
|
push @results, |
372
|
|
|
|
|
|
|
info( |
373
|
|
|
|
|
|
|
EXPIRE_LOWER_THAN_REFRESH => { |
374
|
|
|
|
|
|
|
expire => $soa_expire, |
375
|
|
|
|
|
|
|
refresh => $soa_refresh, |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
); |
378
|
|
|
|
|
|
|
} |
379
|
7
|
100
|
|
|
|
23
|
if ( not scalar @results ) { |
380
|
3
|
|
|
|
|
16
|
push @results, |
381
|
|
|
|
|
|
|
info( |
382
|
|
|
|
|
|
|
EXPIRE_MINIMUM_VALUE_OK => { |
383
|
|
|
|
|
|
|
expire => $soa_expire, |
384
|
|
|
|
|
|
|
refresh => $soa_refresh, |
385
|
|
|
|
|
|
|
required_expire => $SOA_EXPIRE_MINIMUM_VALUE, |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
); |
388
|
|
|
|
|
|
|
} |
389
|
|
|
|
|
|
|
} ## end if ( $p and my ( $soa ...)) |
390
|
|
|
|
|
|
|
else { |
391
|
1
|
|
|
|
|
5
|
push @results, info( NO_RESPONSE_SOA_QUERY => {} ); |
392
|
|
|
|
|
|
|
} |
393
|
|
|
|
|
|
|
|
394
|
8
|
|
|
|
|
46
|
return @results; |
395
|
|
|
|
|
|
|
} ## end sub zone05 |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
sub zone06 { |
398
|
8
|
|
|
8
|
1
|
29
|
my ( $class, $zone ) = @_; |
399
|
8
|
|
|
|
|
11
|
my @results; |
400
|
|
|
|
|
|
|
|
401
|
8
|
|
|
|
|
195
|
my $p = _retrieve_record_from_zone( $zone, $zone->name, q{SOA} ); |
402
|
|
|
|
|
|
|
|
403
|
8
|
100
|
66
|
|
|
153
|
if ( $p and my ( $soa ) = $p->get_records( q{SOA}, q{answer} ) ) { |
404
|
7
|
|
|
|
|
28
|
my $soa_minimum = $soa->minimum; |
405
|
7
|
100
|
|
|
|
37
|
if ( $soa_minimum > $SOA_DEFAULT_TTL_MAXIMUM_VALUE ) { |
|
|
100
|
|
|
|
|
|
406
|
1
|
|
|
|
|
8
|
push @results, |
407
|
|
|
|
|
|
|
info( |
408
|
|
|
|
|
|
|
SOA_DEFAULT_TTL_MAXIMUM_VALUE_HIGHER => { |
409
|
|
|
|
|
|
|
minimum => $soa_minimum, |
410
|
|
|
|
|
|
|
highest_minimum => $SOA_DEFAULT_TTL_MAXIMUM_VALUE, |
411
|
|
|
|
|
|
|
} |
412
|
|
|
|
|
|
|
); |
413
|
|
|
|
|
|
|
} |
414
|
|
|
|
|
|
|
elsif ( $soa_minimum < $SOA_DEFAULT_TTL_MINIMUM_VALUE ) { |
415
|
1
|
|
|
|
|
13
|
push @results, |
416
|
|
|
|
|
|
|
info( |
417
|
|
|
|
|
|
|
SOA_DEFAULT_TTL_MAXIMUM_VALUE_LOWER => { |
418
|
|
|
|
|
|
|
minimum => $soa_minimum, |
419
|
|
|
|
|
|
|
lowest_minimum => $SOA_DEFAULT_TTL_MINIMUM_VALUE, |
420
|
|
|
|
|
|
|
} |
421
|
|
|
|
|
|
|
); |
422
|
|
|
|
|
|
|
} |
423
|
|
|
|
|
|
|
else { |
424
|
5
|
|
|
|
|
65
|
push @results, |
425
|
|
|
|
|
|
|
info( |
426
|
|
|
|
|
|
|
SOA_DEFAULT_TTL_MAXIMUM_VALUE_OK => { |
427
|
|
|
|
|
|
|
minimum => $soa_minimum, |
428
|
|
|
|
|
|
|
highest_minimum => $SOA_DEFAULT_TTL_MAXIMUM_VALUE, |
429
|
|
|
|
|
|
|
lowest_minimum => $SOA_DEFAULT_TTL_MINIMUM_VALUE, |
430
|
|
|
|
|
|
|
} |
431
|
|
|
|
|
|
|
); |
432
|
|
|
|
|
|
|
} |
433
|
|
|
|
|
|
|
} ## end if ( $p and my ( $soa ...)) |
434
|
|
|
|
|
|
|
else { |
435
|
1
|
|
|
|
|
5
|
push @results, info( NO_RESPONSE_SOA_QUERY => {} ); |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
|
438
|
8
|
|
|
|
|
52
|
return @results; |
439
|
|
|
|
|
|
|
} ## end sub zone06 |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
sub zone07 { |
442
|
8
|
|
|
8
|
1
|
24
|
my ( $class, $zone ) = @_; |
443
|
8
|
|
|
|
|
17
|
my @results; |
444
|
|
|
|
|
|
|
|
445
|
8
|
|
|
|
|
189
|
my $p = _retrieve_record_from_zone( $zone, $zone->name, q{SOA} ); |
446
|
|
|
|
|
|
|
|
447
|
8
|
100
|
66
|
|
|
124
|
if ( $p and my ( $soa ) = $p->get_records( q{SOA}, q{answer} ) ) { |
448
|
7
|
|
|
|
|
96
|
my $soa_mname = $soa->mname; |
449
|
7
|
|
|
|
|
43
|
$soa_mname =~ s/[.]\z//smx; |
450
|
7
|
|
|
|
|
18
|
my $addresses_nb = 0; |
451
|
7
|
|
|
|
|
19
|
foreach my $address_type ( q{A}, q{AAAA} ) { |
452
|
14
|
|
|
|
|
73
|
my $p_mname = Zonemaster::Engine::Recursor->recurse( $soa_mname, $address_type ); |
453
|
14
|
50
|
|
|
|
50
|
if ( $p_mname ) { |
454
|
14
|
100
|
|
|
|
64
|
if ( $p_mname->has_rrs_of_type_for_name( $address_type, $soa_mname ) ) { |
455
|
6
|
|
|
|
|
15
|
$addresses_nb++; |
456
|
|
|
|
|
|
|
} |
457
|
14
|
100
|
|
|
|
60
|
if ( $p_mname->has_rrs_of_type_for_name( q{CNAME}, $soa_mname ) ) { |
458
|
2
|
|
|
|
|
11
|
push @results, |
459
|
|
|
|
|
|
|
info( |
460
|
|
|
|
|
|
|
MNAME_IS_CNAME => { |
461
|
|
|
|
|
|
|
mname => $soa_mname, |
462
|
|
|
|
|
|
|
} |
463
|
|
|
|
|
|
|
); |
464
|
|
|
|
|
|
|
} |
465
|
|
|
|
|
|
|
else { |
466
|
12
|
|
|
|
|
65
|
push @results, |
467
|
|
|
|
|
|
|
info( |
468
|
|
|
|
|
|
|
MNAME_IS_NOT_CNAME => { |
469
|
|
|
|
|
|
|
mname => $soa_mname, |
470
|
|
|
|
|
|
|
} |
471
|
|
|
|
|
|
|
); |
472
|
|
|
|
|
|
|
} |
473
|
|
|
|
|
|
|
} ## end if ( $p_mname ) |
474
|
|
|
|
|
|
|
} ## end foreach my $address_type ( ...) |
475
|
7
|
100
|
|
|
|
30
|
if ( not $addresses_nb ) { |
476
|
2
|
|
|
|
|
10
|
push @results, |
477
|
|
|
|
|
|
|
info( |
478
|
|
|
|
|
|
|
MNAME_HAS_NO_ADDRESS => { |
479
|
|
|
|
|
|
|
mname => $soa_mname, |
480
|
|
|
|
|
|
|
} |
481
|
|
|
|
|
|
|
); |
482
|
|
|
|
|
|
|
} |
483
|
|
|
|
|
|
|
} ## end if ( $p and my ( $soa ...)) |
484
|
|
|
|
|
|
|
else { |
485
|
1
|
|
|
|
|
4
|
push @results, info( NO_RESPONSE_SOA_QUERY => {} ); |
486
|
|
|
|
|
|
|
} |
487
|
|
|
|
|
|
|
|
488
|
8
|
|
|
|
|
64
|
return @results; |
489
|
|
|
|
|
|
|
} ## end sub zone07 |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
sub zone08 { |
492
|
7
|
|
|
7
|
1
|
17
|
my ( $class, $zone ) = @_; |
493
|
7
|
|
|
|
|
15
|
my @results; |
494
|
|
|
|
|
|
|
|
495
|
7
|
|
|
|
|
186
|
my $p = $zone->query_auth( $zone->name, q{MX} ); |
496
|
|
|
|
|
|
|
|
497
|
7
|
50
|
|
|
|
31
|
if ( $p ) { |
498
|
7
|
50
|
|
|
|
194
|
if ( $p->has_rrs_of_type_for_name( q{CNAME}, $zone->name ) ) { |
499
|
0
|
|
|
|
|
0
|
push @results, info( MX_RECORD_IS_CNAME => {} ); |
500
|
|
|
|
|
|
|
} |
501
|
|
|
|
|
|
|
else { |
502
|
7
|
|
|
|
|
33
|
push @results, info( MX_RECORD_IS_NOT_CNAME => {} ); |
503
|
|
|
|
|
|
|
} |
504
|
|
|
|
|
|
|
} |
505
|
|
|
|
|
|
|
else { |
506
|
0
|
|
|
|
|
0
|
push @results, info( NO_RESPONSE_MX_QUERY => {} ); |
507
|
|
|
|
|
|
|
} |
508
|
|
|
|
|
|
|
|
509
|
7
|
|
|
|
|
27
|
return @results; |
510
|
|
|
|
|
|
|
} ## end sub zone08 |
511
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
sub zone09 { |
513
|
8
|
|
|
8
|
1
|
23
|
my ( $class, $zone ) = @_; |
514
|
8
|
|
|
|
|
17
|
my @results; |
515
|
|
|
|
|
|
|
my $info; |
516
|
|
|
|
|
|
|
|
517
|
8
|
|
|
|
|
188
|
my $p = $zone->query_auth( $zone->name, q{MX} ); |
518
|
|
|
|
|
|
|
|
519
|
8
|
50
|
|
|
|
38
|
if ( $p ) { |
520
|
8
|
100
|
|
|
|
234
|
if ( not $p->has_rrs_of_type_for_name( q{MX}, $zone->name ) ) { |
521
|
5
|
|
|
|
|
131
|
my $p_a = _retrieve_record_from_zone( $zone, $zone->name, q{A} ); |
522
|
5
|
|
|
|
|
145
|
my $p_aaaa = _retrieve_record_from_zone( $zone, $zone->name, q{AAAA} ); |
523
|
5
|
100
|
66
|
|
|
67
|
if ( |
524
|
|
|
|
|
|
|
( not defined $p_a and not defined $p_aaaa ) |
525
|
|
|
|
|
|
|
or ( ( not defined $p_a or not $p_a->has_rrs_of_type_for_name( q{A}, $zone->name ) ) |
526
|
|
|
|
|
|
|
and ( not defined $p_aaaa or not $p_aaaa->has_rrs_of_type_for_name( q{AAAA}, $zone->name ) ) ) |
527
|
|
|
|
|
|
|
) |
528
|
|
|
|
|
|
|
{ |
529
|
4
|
|
|
|
|
17
|
push @results, info( NO_MX_RECORD => {} ); |
530
|
|
|
|
|
|
|
} |
531
|
|
|
|
|
|
|
else { |
532
|
1
|
50
|
|
|
|
26
|
my @as = defined $p_a ? $p_a->get_records_for_name( q{A}, $zone->name ) : (); |
533
|
1
|
50
|
|
|
|
4
|
my @aaas = defined $p_aaaa ? $p_aaaa->get_records_for_name( q{AAAA}, $zone->name ) : (); |
534
|
1
|
50
|
|
|
|
3
|
$info = join q{/}, map { $_ =~ /:/smx ? q{AAAA=} . $_->address : q{A=} . $_->address } ( @as, @aaas ); |
|
1
|
|
|
|
|
41
|
|
535
|
|
|
|
|
|
|
} |
536
|
|
|
|
|
|
|
} |
537
|
|
|
|
|
|
|
else { |
538
|
3
|
|
|
|
|
74
|
my @mx = $p->get_records_for_name( q{MX}, $zone->name ); |
539
|
3
|
|
|
|
|
12
|
for my $mx ( @mx ) { |
540
|
5
|
|
|
|
|
13
|
my $tmp = q{MX=}; |
541
|
5
|
|
|
|
|
30
|
$tmp .= $mx->exchange; |
542
|
5
|
|
|
|
|
23
|
$tmp =~ s/[.]\z//smx; |
543
|
5
|
|
|
|
|
15
|
$info .= $tmp . q{/}; |
544
|
|
|
|
|
|
|
} |
545
|
3
|
|
|
|
|
12
|
chop $info; |
546
|
|
|
|
|
|
|
} |
547
|
8
|
100
|
|
|
|
65
|
if ( not scalar @results ) { |
548
|
4
|
|
|
|
|
22
|
push @results, info( MX_RECORD_EXISTS => { info => $info } ); |
549
|
|
|
|
|
|
|
} |
550
|
|
|
|
|
|
|
} ## end if ( $p ) |
551
|
|
|
|
|
|
|
else { |
552
|
0
|
|
|
|
|
0
|
push @results, info( NO_RESPONSE_MX_QUERY => {} ); |
553
|
|
|
|
|
|
|
} |
554
|
|
|
|
|
|
|
|
555
|
8
|
|
|
|
|
28
|
return @results; |
556
|
|
|
|
|
|
|
} ## end sub zone09 |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
sub _retrieve_record_from_zone { |
559
|
68
|
|
|
68
|
|
177
|
my ( $zone, $name, $type ) = @_; |
560
|
|
|
|
|
|
|
|
561
|
|
|
|
|
|
|
# Return response from the first authoritative server that gives one |
562
|
68
|
|
|
|
|
95
|
foreach my $ns ( @{ Zonemaster::Engine::TestMethods->method5( $zone ) } ) { |
|
68
|
|
|
|
|
235
|
|
563
|
|
|
|
|
|
|
|
564
|
72
|
100
|
|
|
|
202
|
if ( _is_ip_version_disabled( $ns ) ) { |
565
|
1
|
|
|
|
|
4
|
next; |
566
|
|
|
|
|
|
|
} |
567
|
|
|
|
|
|
|
|
568
|
71
|
|
|
|
|
227
|
my $p = $ns->query( $name, $type ); |
569
|
|
|
|
|
|
|
|
570
|
71
|
100
|
66
|
|
|
353
|
if ( defined $p and scalar $p->get_records( $type, q{answer} ) > 0 ) { |
571
|
52
|
50
|
|
|
|
187
|
return $p if $p->aa; |
572
|
|
|
|
|
|
|
} |
573
|
|
|
|
|
|
|
} |
574
|
|
|
|
|
|
|
|
575
|
16
|
|
|
|
|
45
|
return; |
576
|
|
|
|
|
|
|
} |
577
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
sub _is_ip_version_disabled { |
579
|
80
|
|
|
80
|
|
250
|
my $ns = shift; |
580
|
|
|
|
|
|
|
|
581
|
80
|
50
|
33
|
|
|
293
|
if ( not Zonemaster::Engine->config->ipv4_ok and $ns->address->version == $IP_VERSION_4 ) { |
582
|
0
|
|
|
|
|
0
|
Zonemaster::Engine->logger->add( SKIP_IPV4_DISABLED => { ns => "$ns" } ); |
583
|
0
|
|
|
|
|
0
|
return 1; |
584
|
|
|
|
|
|
|
} |
585
|
|
|
|
|
|
|
|
586
|
80
|
100
|
100
|
|
|
190
|
if ( not Zonemaster::Engine->config->ipv6_ok and $ns->address->version == $IP_VERSION_6 ) { |
587
|
2
|
|
|
|
|
38
|
Zonemaster::Engine->logger->add( SKIP_IPV6_DISABLED => { ns => "$ns" } ); |
588
|
2
|
|
|
|
|
11
|
return 1; |
589
|
|
|
|
|
|
|
} |
590
|
|
|
|
|
|
|
|
591
|
78
|
|
|
|
|
236
|
return; |
592
|
|
|
|
|
|
|
} |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
1; |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
=head1 NAME |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
Zonemaster::Engine::Test::Zone - module implementing tests of the zone content in DNS, such as SOA and MX records |
599
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
=head1 SYNOPSIS |
601
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
my @results = Zonemaster::Engine::Test::Zone->all($zone); |
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
=head1 METHODS |
605
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
=over |
607
|
|
|
|
|
|
|
|
608
|
|
|
|
|
|
|
=item all($zone) |
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
Runs the default set of tests and returns a list of log entries made by the tests |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
=item translation() |
613
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
Returns a refernce to a hash with translation data. Used by the builtin translation system. |
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
=item metadata() |
617
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
Returns a reference to a hash, the keys of which are the names of all test methods in the module, and the corresponding values are references to |
619
|
|
|
|
|
|
|
lists with all the tags that the method can use in log entries. |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
=item version() |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
Returns a version string for the module. |
624
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
=back |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
=head1 TESTS |
628
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
=over |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
=item zone01($zone) |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
Check that master nameserver in SOA is fully qualified. |
634
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
=item zone02($zone) |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
Verify SOA 'refresh' minimum value. |
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
=item zone03($zone) |
640
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
Verify SOA 'retry' value is lower than SOA 'refresh' value. |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
=item zone04($zone) |
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
Verify SOA 'retry' minimum value. |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
=item zone05($zone) |
648
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
Verify SOA 'expire' minimum value. |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
=item zone06($zone) |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
Verify SOA 'minimum' (default TTL) value. |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
=item zone07($zone) |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
Verify that SOA master is not an alias (CNAME). |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
=item zone08($zone) |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
Verify that MX records does not resolve to a CNAME. |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
=item zone09($zone) |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
Verify that there is a target host (MX, A or AAAA) to deliver e-mail for the domain name. |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
=back |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
=cut |