Skip to content

Commit

Permalink
check for possible CNAME overrides of A/AAAA record in dns-editor, fixes
Browse files Browse the repository at this point in the history
 #864

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Jun 23, 2020
1 parent d653f68 commit 7c3ff95
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Froxlor/Dns/Dns.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ public static function createDomainZone($domain_id, $froxlorhostname = false, $i
// use the first NS entry as primary ns
$primary_ns = $entry['content'];
}
// check for CNAME on @, www- or wildcard-Alias and remove A/AAAA record accordingly
foreach (['@', 'www', '*'] as $crceord) {
if ($entry['type'] == 'CNAME' && $entry['record'] == '@' && (array_key_exists(md5($crceord), $required_entries['A']) || array_key_exists(md5($crceord), $required_entries['AAAA']))) {
unset($required_entries['A'][md5($crceord)]);
unset($required_entries['AAAA'][md5($crceord)]);
}
}
$zonerecords[] = new DnsEntry($entry['record'], $entry['type'], $entry['content'], $entry['prio'], $entry['ttl']);
}

Expand Down

0 comments on commit 7c3ff95

Please sign in to comment.