{"record":{"id":"cfe8069d60663315","repo":"nextcloud/all-in-one","slug":"dns-config-is-not-set-for-this-domain-or-the-domai","errorCode":null,"errorMessage":"DNS config is not set for this domain or the domain is not a valid domain! (It was found to be set to '${dnsRecordIP}')","messagePattern":"DNS config is not set for this domain or the domain is not a valid domain! \\(It was found to be set to '(.+?)'\\)","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"error","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":640,"sourceCode":"        // Skip domain validation if opted in to do so\n        if ($this->shouldDomainValidationBeSkipped($skipDomainValidation)) {\n            error_log('Skipping domain validation');\n        } else {\n            $dnsRecordIP = gethostbyname($domain);\n            if ($dnsRecordIP === $domain) {\n                $dnsRecordIP = '';\n            }\n\n            if (empty($dnsRecordIP)) {\n                $record = dns_get_record($domain, DNS_AAAA);\n                if (isset($record[0]['ipv6']) && !empty($record[0]['ipv6'])) {\n                    $dnsRecordIP = $record[0]['ipv6'];\n                }\n            }\n\n            // Validate IP\n            if (!filter_var($dnsRecordIP, FILTER_VALIDATE_IP)) {\n                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 . \"')\");\n            }\n\n            // Get the apache port\n            $port = $this->apachePort;\n\n            if (!filter_var($dnsRecordIP, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {\n                if ($port === '443') {\n                    throw new InvalidSettingConfigurationException(\"It seems like the ip-address of the domain is set to an internal or reserved ip-address. This is not supported by the domain validation. (It was found to be set to '\" . $dnsRecordIP . \"'). Please set it to a public ip-address so that the domain validation can work or skip the domain validation!\");\n                } else {\n                    error_log(\"Info: It seems like the ip-address of \" . $domain . \" is set to an internal or reserved ip-address. (It was found to be set to '\" . $dnsRecordIP . \"')\");\n                }\n            }\n\n            // Check if port 443 is open\n            $connection = @fsockopen($domain, 443, $errno, $errstr, 10);\n            if ($connection) {\n                fclose($connection);\n            } else {","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L622-L658","documentation":"First network check in ConfigurationManager::setDomain() (only when domain validation is not skipped): the domain must resolve to a usable IP via gethostbyname (A record) or dns_get_record (AAAA record); if neither yields a valid IP, the exception is thrown and ConfigurationController returns HTTP 422. The parenthesised value in the message shows what was resolved — usually an empty string, meaning no A/AAAA record was found at all. This is a DNS-state problem, not a syntax problem: all syntactic checks already passed.","triggerScenarios":"Typo'd domain ('cloudd.example.com'); domain registered but no A/AAAA record created yet; DNS record created moments ago and not yet propagated; the mastercontainer has broken DNS (bad resolv.conf, DNSSEC failure, unreachable resolver) so resolution fails inside the container while working on the host.","commonSituations":"Fresh installs where the DNS record was forgotten; split-DNS setups where the record only exists on the LAN resolver; Docker hosts with filtered or broken upstream DNS.","solutions":["Verify from the host: 'dig +short cloud.example.com A' and 'dig +short cloud.example.com AAAA' — at least one must return an IP","Create the missing A record pointing at your server's public IP (an AAAA record alone also works)","If resolution works on the host but not inside the container, fix the Docker/mastercontainer DNS setup (check the host resolv.conf and any --dns settings)","For intentionally unresolvable staging domains, tick 'skip domain validation' in the AIO dialog or set SKIP_DOMAIN_VALIDATION=true on the mastercontainer"],"exampleFix":"# before\ncloud.example.com has no A/AAAA record\n# after\ncloud.example.com. 300 IN A 203.0.113.10","handlingStrategy":"try-catch","validationCode":"// Pre-flight the DNS state the same way the mastercontainer will\nif (!checkdnsrr($domain, 'A') && !checkdnsrr($domain, 'AAAA')) {\n    $errors[] = 'No A/AAAA record found — create DNS before submitting';\n}","typeGuard":"function isInvalidSettingConfigurationException(\\Throwable $e): bool {\n    return $e instanceof \\AIO\\Data\\InvalidSettingConfigurationException;\n}","tryCatchPattern":"use AIO\\Data\\InvalidSettingConfigurationException;\n\ntry {\n    $configurationManager->setDomain($domain, $skipDomainValidation);\n} catch (InvalidSettingConfigurationException $e) {\n    // message embeds the resolved value; show it and let the user fix DNS or skip\n    $formErrors[] = $e->getMessage();\n}","preventionTips":["Run dig +short <domain> A/AAAA from the Docker host before starting AIO domain setup","Ensure the mastercontainer has working upstream DNS (check resolv.conf / --dns)","For staging domains without DNS, pass the skip_domain_validation flag deliberately"],"tags":["php","nextcloud-aio","dns","domain-validation","configuration","network"],"backgroundTag":"dns-resolution-failed","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}