From 1f792466bf287284bc76641662b6a0ca7194c432 Mon Sep 17 00:00:00 2001 From: Daniel Reichelt Date: Sat, 20 Feb 2021 21:32:52 +0100 Subject: [PATCH] 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 --- lib/Froxlor/Dns/Dns.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Froxlor/Dns/Dns.php b/lib/Froxlor/Dns/Dns.php index 8e0b8b0c..2fb85de8 100644 --- a/lib/Froxlor/Dns/Dns.php +++ b/lib/Froxlor/Dns/Dns.php @@ -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