pfSense dyndns for Namecheap doesn't work with hostnames containing "."
|Assignee:||Jim P||% Done:||
|Affected version:||2.0.1||Affected Architecture:||All|
Namecheap happily supports hostnames like www.sub.domain.com. Their Windows dyndns client also supports hostnames that include ".".
However, it appears that pfSense incorrectly determines the hostname as www and domain name as sub.domain.com instead of the hostname as www.sub and domain name domain.com. Or at least this is what I'm assuming since the log on pfSense is returning an error of domain not found in this scenario.
Jan 25 16:34:17 php: /services_dyndns_edit.php: DynDns: DynDns _update() starting.
Jan 25 16:34:17 php: /services_dyndns_edit.php: Namecheap: DNS update() starting.
Jan 25 16:34:17 php: /services_dyndns_edit.php: DynDns: DynDns _checkStatus() starting.
Jan 25 16:34:17 php: /services_dyndns_edit.php: DynDns: Current Service: namecheap
Jan 25 16:34:17 php: /services_dyndns_edit.php: DynDns debug information: x.x.x.x extracted from local system.
Jan 25 16:34:17 php: /services_dyndns_edit.php: phpDynDNS: updating cache file /conf/dyndns_wannamecheap'host.sub.domain.com'.cache: x.x.x.x
Jan 25 16:34:17 php: /services_dyndns_edit.php: phpDynDNS: (Error) Domain name not found
#1 Updated by Jim P about 2 years ago
- Category set to DynDNS
- Target version set to 2.1
- Affected Architecture set to All
(Copying my reply from the forum post here)
Yeah we split on ., I didn't realize their client supported that syntax.
Though that makes things a little trickier, right now it's just this:
list($hostname, $domain) = explode(".", $this->_dnsHost, 2);
To do the other way, it would have to split by making an array there and taking the last two, but then that would break things like co.uk and org.uk
I suppose because namecheap doesn't use the username field we could use that as a prefix for the host, so it would be hostname=sub.domain.org, username=www, so the whole record would end up being: host=www.sub domain=domain.com - but that's sure not intuitive...
#2 Updated by Doug Dimick about 2 years ago
It's probable that other dyndns providers also accept hostnames including dots, since it's legal A record syntax. This could be more pervasive than just Namecheap. In that case, splitting host/domain into two fields on the page for all dyndns providers would be a good solution. Much easier to just implode for providers that don't separate hostname and domain in their update syntax.
#3 Updated by Jim P about 2 years ago
Except that would break everyone's current settings unless we tried to be smart with some upgrade code (which could still guess wrong).
Another way (one I'll probably commit at least for now) since Namecheap only supports .co.uk / .org.uk / .me.uk is something like this:
$dparts = explode(".", $this->_dnsHost); $domain_part_count = ($dparts[count($dparts)-1] == "uk") ? 3 : 2; $domain_offset = count($dparts) - $domain_part_count; $hostname = implode(".", array_slice($dparts, 0, $domain_offset)); $domain = implode(".", array_slice($dparts, $domain_offset));
Other providers would not be affected because none of the other providers require separate hostname and domain parameters except for Namecheap, so it would still be redesigning the whole page to support one provider.
#4 Updated by Jim P about 2 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset e8fc69ff43bb089f90de4f87f02db44f55a96b40.
#5 Updated by Jim P about 2 years ago
Applied in changeset 89bbb204ad58c4d0250ebabf34ebec1996a53088.