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);
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…
Adding another field to the page isn't really feasible, the whole page would need to be redesigned with some javascript to only show the field when namecheap is selected, or we could use some other kind of delimiter inside of the hostname field perhaps "www.sub;domain.com" that it could fall back to if it's found.
-
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.
https://github.com/bsdperimeter/pfsense/commit/89bbb204ad58c4d0250ebabf34ebec1996a53088
-
Patch tested and working. Thanks for the quick fix!