line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DNS::Record::Check; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26913
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
205
|
|
4
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2527
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
DNS::Record::Check - Provides checks for some common DNS records. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.0.0 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.0.0'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use DNS::Record::Check; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $dnsrc=DNS::Record::Check->new; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
if($dnsrc->A($recordValue)){ |
26
|
|
|
|
|
|
|
warn($recordValue.' is not a valid a record'); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 new |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This initiates the object. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$dnsrc=DNS::Record::Check->new; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new{ |
40
|
0
|
|
|
0
|
1
|
|
my $self={}; |
41
|
0
|
|
|
|
|
|
bless $self; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return $self; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 A |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Checks if a A record value is valid. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $return=$dnsrc->A($value); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head3 Return Values |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head4 0 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Valid. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head4 1 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Not defined. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head4 2 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Contains non-numeric or period characters. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head4 3 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
It has less than four numbers. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head4 4 |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
It has more than four numbers. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head4 5 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
The number is 0. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head4 6 |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
One of the numbers is greater than 255. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head4 7 |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
The fourth number is zero. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub A{ |
89
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
#makes sure the record is defined |
92
|
0
|
0
|
|
|
|
|
if (!defined($record)) { |
93
|
0
|
|
|
|
|
|
return 1; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
#make sure it does no |
97
|
0
|
0
|
|
|
|
|
if (!($record =~ /^[0123456789\.]*$/)) { |
98
|
0
|
|
|
|
|
|
return 2; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
#checks each byte |
102
|
0
|
|
|
|
|
|
my @recordSplit=split(/\./, $record); |
103
|
0
|
|
|
|
|
|
my $int=0; |
104
|
0
|
|
|
|
|
|
while (defined($recordSplit[$int])) { |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
#if we are at 4, it means there are 5 bytes |
107
|
0
|
0
|
|
|
|
|
if ($recordSplit[$int] == 4) { |
108
|
0
|
|
|
|
|
|
return 4; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
#check if the first byte is equal to zero |
112
|
0
|
0
|
|
|
|
|
if ($int == 0) { |
113
|
0
|
0
|
|
|
|
|
if ($recordSplit[$int] == 0) { |
114
|
0
|
|
|
|
|
|
return 5; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
#makes sure the byde is not larger than 255 |
119
|
0
|
0
|
|
|
|
|
if ($recordSplit[$int] > 255) { |
120
|
0
|
|
|
|
|
|
return 6; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
#check if the last number is zero |
124
|
0
|
0
|
|
|
|
|
if ($int == 3) { |
125
|
0
|
0
|
|
|
|
|
if ($recordSplit[$int] == 0) { |
126
|
0
|
|
|
|
|
|
return 7; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
$int++; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
0
|
0
|
|
|
|
|
if ($int < 4) { |
134
|
0
|
|
|
|
|
|
return 3; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
return 0; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head2 AAAA |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Checks if a AAAA record value is valid. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
my $return=$dnsrc->AAAA($value); |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head3 Return Values |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head4 0 |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
Valid. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head4 1 |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Not defined. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head4 2 |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Found characters that do not match a AAAA record. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head4 3 |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Matched more than two semi-colons in a row. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=cut |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub AAAA{ |
167
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
#makes sure the record is defined |
170
|
0
|
0
|
|
|
|
|
if (!defined($record)) { |
171
|
0
|
|
|
|
|
|
return 1; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
#make sure it does no |
175
|
0
|
0
|
|
|
|
|
if (!($record =~ /^[0123456789AaBbCcDdEeFf\:]*$/)) { |
176
|
0
|
|
|
|
|
|
return 2; |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
#make sure it does not have more than two : in a row |
180
|
0
|
0
|
|
|
|
|
if ($record =~ /\:\:\:/) { |
181
|
0
|
|
|
|
|
|
return 3; |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
0
|
|
|
|
|
|
return 0; |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head2 CNAME |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Checks if a CNAME record value is valid. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
my $return=$dnsrc->CNAME($value); |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head3 Return Values |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head4 0 |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Valid. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head4 1 |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Not defined. |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head4 2 |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
Non-alphanumeric/period characters found. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=head4 3 |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
The host name begins with a period. |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=cut |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
sub CNAME{ |
214
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
#makes sure the record is defined |
217
|
0
|
0
|
|
|
|
|
if (!defined($record)) { |
218
|
0
|
|
|
|
|
|
return 1; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
#makes sure no Non-alphanumeric/period characters found. |
222
|
0
|
0
|
|
|
|
|
if (!($record=~/^[[:alnum:]\.]*$/)) { |
223
|
0
|
|
|
|
|
|
return 2; |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
#makes sure it does not begin with a period |
227
|
0
|
0
|
|
|
|
|
if ($record =~ /^\./) { |
228
|
0
|
|
|
|
|
|
return 3; |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
0
|
|
|
|
|
|
return 0; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=head2 HINFO |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
Check a HINFO record value. |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
my $return=$dnsrc->HINFO($value); |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=head3 Return Values |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
=head4 0 |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
Valid. |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=head4 1 |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
Undefined. |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=head4 2 |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Does not start with a leter. |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=head4 3 |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
Contains values outside of capital letters, numbers, forwdward |
257
|
|
|
|
|
|
|
slash, or a hyphen. |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=head4 4 |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Does not end in either a capital letter or number. |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=cut |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
sub HINFO{ |
266
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
#makes sure the record is defined |
269
|
0
|
0
|
|
|
|
|
if (!defined($record)) { |
270
|
0
|
|
|
|
|
|
return 1; |
271
|
|
|
|
|
|
|
} |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
#make sure it starts with a capital letter |
274
|
0
|
0
|
|
|
|
|
if (!($record =~ /^[A-Z]/)) { |
275
|
0
|
|
|
|
|
|
return 2; |
276
|
|
|
|
|
|
|
} |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
#makes sure it only contains the required characters |
279
|
0
|
0
|
|
|
|
|
if (!($record =~ /^[A-Z0-1\-\/]$/)) { |
280
|
0
|
|
|
|
|
|
return 3; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
#makes sure it ends in either a number or letter |
284
|
0
|
0
|
|
|
|
|
if (!($record =~ /[A-Z0-1]$/)) { |
285
|
0
|
|
|
|
|
|
return 4; |
286
|
|
|
|
|
|
|
} |
287
|
|
|
|
|
|
|
|
288
|
0
|
|
|
|
|
|
return 0; |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
=head2 MX |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
The MX value is not valid. |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
my $return=$dnsrc->MX($value); |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=head3 Return Values |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
=head4 0 |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
Valid. |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
=head4 1 |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
Undefined. |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=head4 2 |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
Non-numeric priority. |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=head4 3 |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
No hostname. |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
=head4 4 |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
The hostname is not a valid domain name. |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=head4 5 |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
Additional information was found after a third space. |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=cut |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
sub MX{ |
326
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
#makes sure the record is defined |
329
|
0
|
0
|
|
|
|
|
if (!defined($record)) { |
330
|
0
|
|
|
|
|
|
return 1; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
#splits the record |
334
|
0
|
|
|
|
|
|
my @recordSplit=split(/\ /, $record); |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
#the priority is not numeric |
337
|
0
|
0
|
|
|
|
|
if (!($recordSplit[0] =~ /^[[:digit:]]$/)) { |
338
|
0
|
|
|
|
|
|
return 2; |
339
|
|
|
|
|
|
|
} |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
#no host name |
342
|
0
|
0
|
|
|
|
|
if (!defined($recordSplit[1])) { |
343
|
0
|
|
|
|
|
|
return 3; |
344
|
|
|
|
|
|
|
} |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
#the CNAME check just checks if it is a valid host name or not |
347
|
0
|
0
|
|
|
|
|
if ($_[0]->CNAME($recordSplit[1])) { |
348
|
0
|
|
|
|
|
|
return 4; |
349
|
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
#has extra info |
352
|
0
|
0
|
|
|
|
|
if (defined($recordSplit[2])) { |
353
|
0
|
|
|
|
|
|
return 5; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
0
|
|
|
|
|
|
return 0; |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=head2 NS |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
Checks if a NS record value is valid. |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
my $return=$dnsrc->NS($value); |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=head3 Return Values |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
See the return value listing for CNAME. |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=cut |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
sub NS{ |
372
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
373
|
|
|
|
|
|
|
|
374
|
0
|
|
|
|
|
|
return $_[0]->CNAME($record); |
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=head2 PTR |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
Checks if a PTR record value is valid. |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
my $return=$dnsrc->PTR($value); |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=head3 Return Values |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
See the return value listing for CNAME. |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=cut |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
sub PTR{ |
390
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
391
|
|
|
|
|
|
|
|
392
|
0
|
|
|
|
|
|
return $_[0]->CNAME($record); |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=head2 RP |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
Checks if a RP record value is valid. |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
my $return=$dnsrc->RP($value); |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=head3 Return Values |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=head4 0 |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
Valid. |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=head4 1 |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
Undefined. |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=head4 2 |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
Invalid email address. |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
=head4 3 |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
Invalid hostname in email address. |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
=cut |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
sub RP{ |
422
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
423
|
|
|
|
|
|
|
|
424
|
0
|
0
|
|
|
|
|
if (!defined($record)) { |
425
|
0
|
|
|
|
|
|
return 1; |
426
|
|
|
|
|
|
|
} |
427
|
|
|
|
|
|
|
|
428
|
0
|
|
|
|
|
|
my @recordSplit=split(/\@/, $record); |
429
|
|
|
|
|
|
|
|
430
|
0
|
0
|
|
|
|
|
if (defined($recordSplit[2])) { |
431
|
0
|
|
|
|
|
|
return 2; |
432
|
|
|
|
|
|
|
} |
433
|
|
|
|
|
|
|
|
434
|
0
|
0
|
|
|
|
|
if (!defined($recordSplit[1])) { |
435
|
0
|
|
|
|
|
|
return 2; |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
|
438
|
0
|
0
|
|
|
|
|
if ($recordSplit[0] =~ /[\!\#\$\%\^\&\*\(\)\;\:\<\>\[\]]/) { |
439
|
0
|
|
|
|
|
|
return 2; |
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
|
442
|
0
|
0
|
|
|
|
|
if (!$_[0]->CNAME($recordSplit[1])) { |
443
|
0
|
|
|
|
|
|
return 3; |
444
|
|
|
|
|
|
|
} |
445
|
|
|
|
|
|
|
|
446
|
0
|
|
|
|
|
|
return 0; |
447
|
|
|
|
|
|
|
} |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
=head2 TXT |
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
Checks if a TXT record value is valid. |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
my $return=$dnsrc->TXT($value); |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=head3 Return Values |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
=head4 0 |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
Valid. |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
=head4 1 |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
Undefined. |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
=cut |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
sub TXT{ |
469
|
0
|
|
|
0
|
1
|
|
my $record=$_[1]; |
470
|
|
|
|
|
|
|
|
471
|
0
|
0
|
|
|
|
|
if (!defined($record)) { |
472
|
0
|
|
|
|
|
|
return 1; |
473
|
|
|
|
|
|
|
} |
474
|
|
|
|
|
|
|
|
475
|
0
|
|
|
|
|
|
return 0; |
476
|
|
|
|
|
|
|
} |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
=head1 AUTHOR |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
Zane C. Bowers, C<< >> |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
=head1 BUGS |
483
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
485
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
486
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
=head1 SUPPORT |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
494
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
perldoc DNS::Record::Check |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
You can also look for information at: |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
=over 4 |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
L |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
507
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
L |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
=item * CPAN Ratings |
511
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
L |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
=item * Search CPAN |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
L |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
=item * SVN Repo |
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
L |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
=back |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
Copyright 2010 Zane C. Bowers. |
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
533
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
534
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
535
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
537
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
=cut |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
1; # End of DNS::Record::Check |