FIX add possibility to override authoritative dns (#35699)

This commit is contained in:
Regis Houssin 2025-10-10 22:25:03 +02:00 committed by GitHub
parent de6a6ef039
commit 6c8fde377c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1074,7 +1074,11 @@ if ($action == 'edit') {
if ($dnstype == 'DMARC') {
$domain = '_dmarc.'.$domain;
}
$dnsinfo = dns_get_record($domain, DNS_TXT);
$authns = (!getDolGlobalString('MAIN_MAIL_OVERRIDE_AUTHORITATIVE_DNS') ? array() : explode(',', getDolGlobalString('MAIN_MAIL_OVERRIDE_AUTHORITATIVE_DNS'))); // eg 8.8.8.8, x.x.x.x
$dnsinfo = @dns_get_record($domain, DNS_TXT, $authns);
if ($dnsinfo === false) {
$text .= ($text ? '<br>' : '').$langs->trans("WarningDNSServerNotAvailable");
}
}
if (!empty($dnsinfo) && is_array($dnsinfo)) {
foreach ($dnsinfo as $info) {