Jump to content
Froxlor Forum
  • 0

O365 cname - Fehler oder Fehlbedienung


rseffner

Question

Microsoft wünscht sich, dass ich u.a. "selector1._domainkey  1D IN CNAME    selector1-DOMAIN-TLD._domainkey.DOMAIN.onmicrosoft.com" im DNS verewige.

Also nutze ich den DNS-Editor auf Domainebene und fülle wie folgt aus:

Record : selector1._domainkey
Type : CNAME
Priority : ich lösche die vorausgefüllte "0"
Content : selector1-DOMAIN-TLD._domainkey.DOMAIN.onmicrosoft.com. (man beachte den Punkt am Ende; natürlich ersetze ich DOMAIN und TLD durch was  Sinnvolles)
TTL : 86400

Froxlor meint dazu aber "Ungültiger Domain-Name für CNAME Eintrag". Mache ich den Fehler (welchen) oder Froxlor?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

That'S because the domainValidate which the content of a CNAME is passed to sees an "underscore" as invalid.

For your specific situation, a "workaround" would be to leave the underscore out of the URL to save the record, then add it directly via mysql/phpmyadmin again to avoid this validation. not nice, but will do

Link to comment
Share on other sites

Würdest du die funktion in der Datei lib/functions/validate/function.validateDomain.php mit dieser ersetzen und mal schauen ob das hinhaut? Meine paar tests bisher gingen durch:

/**
 * Check if the submitted string is a valid domainname
 *
 * @param string $domainname
 *        	The domainname which should be checked.
 * @param bool $allow_underscore
 *        	optional if true, allowes the underscore character in a domain label (DKIM etc.)
 *        	
 * @return string|boolean the domain-name if the domain is valid, false otherwise
 */
function validateDomain($domainname, $allow_underscore = false)
{
	$char_validation = '([a-z\d](-*[a-z\d])*)(\.?([a-z\d](-*[a-z\d])*))*\.([a-z\d])+';
	if ($allow_underscore) {
		$char_validation = '([a-z\d\_](-*[a-z\d])*)(\.([a-z\d\_](-*[a-z\d])*))*(\.?([a-z\d](-*[a-z\d])*))+\.([a-z\d])+';
	}

	if (preg_match("/^" . $char_validation . "$/i", $domainname) && // valid chars check
	preg_match("/^.{1,253}$/", $domainname) && // overall length check
	preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domainname)) // length of each label
	{
		return $domainname;
	}
	return false;
}

 

Link to comment
Share on other sites

achso, ja und natürlich in der API an entsprechender Stelle das underscore erlauben:

diff --git a/lib/classes/api/commands/class.DomainZones.php b/lib/classes/api/commands/class.DomainZones.php
index 748006d2..9be1cbde 100644
--- a/lib/classes/api/commands/class.DomainZones.php
+++ b/lib/classes/api/commands/class.DomainZones.php
@@ -162,7 +162,7 @@ class DomainZones extends ApiCommand implements ResourceEntity
                                // add domain name
                                $content .= '.' . $domain;
                        }
-                       if (! validateDomain($content)) {
+                       if (! validateDomain($content, true)) {
                                $errors[] = $this->lng['error']['dns_cname_invaliddom'];
                        } else {
                                // check whether there are RR-records for the same resource

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...