Jump to content
Froxlor Forum
  • 0
rseffner

O365 cname - Fehler oder Fehlbedienung

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?

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

Dann wäre sie ja nicht RFC konform... Muss ich mir was anderes überlegen für cname speziell

Share this post


Link to post
Share on other sites
  • 0

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;
}

 

Share this post


Link to post
Share on other sites
  • 0

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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now





×
×
  • Create New...