From 00c6eeda44e6187461e07bba7a8c633a5880d7c6 Mon Sep 17 00:00:00 2001 From: szaimen Date: Thu, 30 Jun 2022 14:47:37 +0200 Subject: [PATCH] domain validation should be compatible with ipv6 only Signed-off-by: szaimen --- php/src/Data/ConfigurationManager.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 6a24bf9a..a7423075 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -203,6 +203,13 @@ class ConfigurationManager $dnsRecordIP = ''; } + if (empty($dnsRecordIP)) { + $record = dns_get_record($domain, DNS_AAAA); + if (!empty($record)) { + $dnsRecordIP = $record[0]['ipv6']; + } + } + // Validate IP if(!filter_var($dnsRecordIP, FILTER_VALIDATE_IP)) { throw new InvalidSettingConfigurationException("DNS config is not set for this domain or the domain is not a valid domain! (It was found to be set to '" . $dnsRecordIP . "')");