Current time: 12-02-2022, 12:07 AM Hello There, Guest! (LoginRegister)

Post Reply 
'invalid' character in a CNAME target?
Author Message
nexusis Offline
Junior Member

Posts: 10
Joined: Jul 2010
Reputation: 0
Post: #1
'invalid' character in a CNAME target?
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.


ispcCP 1.07
Deb Lenny 64bit.


/var/www/ispcp/gui/client/dns_edit.php has the following 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?

(This post was last modified: 10-18-2011 11:30 AM by nexusis.)
10-18-2011 09:50 AM
Find all posts by this user Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)