dns: check NS entry to be used as primary NS

Don't just blindly use the first custom NS entry for SOA, actually check
if it pertains to the domain in question
This commit is contained in:
Daniel Reichelt
2021-02-20 21:32:52 +01:00
committed by Daniel Reichelt
parent 5a6343b47c
commit 1f792466bf

View File

@@ -181,8 +181,8 @@ class Dns
// unset special spf required-entry
unset($required_entries[$entry['type']][md5("@SPF@")]);
}
if (empty($primary_ns) && $entry['type'] == 'NS') {
// use the first NS entry as primary ns
if (empty($primary_ns) && $entry['record'] == '@' && $entry['type'] == 'NS') {
// use the first NS entry pertaining to the current domain as primary ns
$primary_ns = $entry['content'];
}
// check for CNAME on @, www- or wildcard-Alias and remove A/AAAA record accordingly