Bug #2144


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

Added by Doug Dimick over 12 years ago. Updated almost 10 years ago.

Dynamic DNS
Target version:
Start date:
Due date:
% Done:


Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:


Namecheap happily supports hostnames like Their Windows dyndns client also supports hostnames that include ".".

However, it appears that pfSense incorrectly determines the hostname as www and domain name as instead of the hostname as www.sub and domain name 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''.cache: x.x.x.x
Jan 25 16:34:17 php: /services_dyndns_edit.php: phpDynDNS: (Error) Domain name not found

Actions #1

Updated by Jim Pingle over 12 years ago

  • Category set to Dynamic DNS
  • Target version set to 2.1
  • Affected Architecture All added
  • Affected Architecture deleted ()

(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 and

I suppose because namecheap doesn't use the username field we could use that as a prefix for the host, so it would be, username=www, so the whole record would end up being: host=www.sub - 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;" that it could fall back to if it's found.

Actions #2

Updated by Doug Dimick over 12 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.

Actions #3

Updated by Jim Pingle over 12 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 / / 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.

Actions #4

Updated by Jim Pingle over 12 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #5

Updated by Jim Pingle over 12 years ago

Actions #6

Updated by Chris Buechler over 12 years ago

can anyone confirm this is fixed?

Actions #7

Updated by Jim Pingle about 12 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.

Actions #8

Updated by Lance Cotton almost 10 years ago

Pardon me for re-opening this old bug, but I've finally gotten tired of manually updating my "dynamic" DNS entry hosted by's service.

My "domain" with namecheap is a delegated sub-domain, within which I have several hosts.

For example, the domain is
I have a host: host1
The complete FQDN is

The current script, as noted in this bugfix, extracts the domain portion by counting "." characters. But that doesn't work for me, as the domain is like the .uk example, but it's a .com.

I understand the hesitation to update the GUI for just this one provider who requires the domain and host entries separated. Could perhaps a non-allowed character be used as a sentinel for the break between host and domain, and the dyndns.class file will split on that? Then the only GUI update might be an added instruction sentence for namecheap users.

For example, I might enter in the pfSense GUI the hostname host1/ to indicate which part is which.


Also available in: Atom PDF