Namecheap dyndns and psuedo-subdomain hostnames.
Namecheap happily supports hostnames like www.sub.domain.com.
However, it appears that the dyndns parser on 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.
Is this something that should work?
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
Discovered today that their Windows dyndns client can handle this scenario without difficulty, so it's definitely a pfSense issue.
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);
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…
Created bug #2144. http://redmine.pfsense.org/issues/2144
Thanks, Jim. Not sure if I should keep this on the bug tracker or here.
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.
Discussion should stay here, mostly.
That would be a valid point except (as I mentioned on the ticket), only Namecheap requires separate parameters, and that would have the potential to break a lot more than it would fix.
I checked in the fix I mentioned on the ticket, you can apply the change by hand and see if it makes it work for you.
Patch tested and working. Thanks for the quick fix!