ispCP - Board - Support
'invalid' character in a CNAME target? - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Usage (/forum-34.html)
+--- Thread: 'invalid' character in a CNAME target? (/thread-15364.html)



'invalid' character in a CNAME target? - nexusis - 10-18-2011 09:50 AM

Trying to add a CNAME to a DNS entry given to me by another provider, which includes "-" in the name.

The entry resolves. Its a valid DNS entry.

However, ispCP is complaining

Cannot validate CNAME record. Reason 'Use of disallowed char("-") in CNAME'.

when I try to add it.

Anyone have a work around, or quick hack? I need to get this up and running soon.

thanks

ispcCP 1.07
Deb Lenny 64bit.

EDIT:

/var/www/ispcp/gui/client/dns_edit.php has the following code:

Code:
function validate_CNAME($record, &$err = null) {

        if (preg_match('~([^a-z,A-Z,0-9\.])~u', $record['dns_cname'], $e)) {
                $err .= sprintf(tr('Use of disallowed char("%s") in CNAME'), $e[1]);
                return false;
        }
.
.
.

so it looks like an easy fix... but that test is there for a reason Smile

Does anyone know if I modify the preg_match to allow the '-' to pass unimpeded, will that cause anything else to fail further on?

Thx