Bug #2144

pfSense dyndns for Namecheap doesn't work with hostnames containing "."

Added by Doug Dimick about 2 years ago. Updated almost 2 years ago.

Status:Resolved Start date:01/26/2012
Priority:Normal Due date:
Assignee:Jim P % Done:

100%

Category:DynDNS
Target version:2.1
Affected version:2.0.1 Affected Architecture:All

Description

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

Associated revisions

Revision 89bbb204
Added by Jim P about 2 years ago

Be smarter about how to split a Namecheap hostname into host/domain. Fixes #2144

Revision e8fc69ff
Added by Jim P about 2 years ago

Be smarter about how to split a Namecheap hostname into host/domain. Fixes #2144

History

#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...

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.

#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

#5 Updated by Jim P about 2 years ago

#6 Updated by Chris Buechler about 2 years ago

can anyone confirm this is fixed?

#7 Updated by Jim P almost 2 years ago

  • Status changed from Feedback to Resolved

I added a hostname with a . to one of my domains using Namecheap DNS and it updated fine, so this is fixed.

Also available in: Atom PDF