Domain might not be found

This commit is contained in:
Jamie Cameron
2019-02-18 18:09:49 -08:00
parent 2713b41292
commit 9ecb8b578d

View File

@@ -952,18 +952,20 @@ return $fn;
sub get_dnskey_record
{
my ($z, $recs) = @_;
my @rv;
my $dom = $z->{'members'} ? $z->{'values'}->[0] : $z->{'name'};
if (!$recs) {
# Need to get zone file and thus records
my $fn = &get_zone_file($z);
$recs = [ &read_zone_file($fn, $dom) ];
}
# Find the record
foreach my $r (@$recs) {
if ($r->{'type'} eq 'DNSKEY' &&
$r->{'name'} eq $dom.'.') {
push(@rv, $r);
my @rv;
if ($dom) {
if (!$recs) {
# Need to get zone file and thus records
my $fn = &get_zone_file($z);
$recs = [ &read_zone_file($fn, $dom) ];
}
# Find the record
foreach my $r (@$recs) {
if ($r->{'type'} eq 'DNSKEY' &&
$r->{'name'} eq $dom.'.') {
push(@rv, $r);
}
}
}
return wantarray ? @rv : $rv[0];