Feature #4366
closedNamecheap Dynamic DNS updates fail on subdomain formatted domains
100%
Description
The domain in question is in the format
sub.domain.com
I need to update the record for this domain.
.sub.domain.com
So, it's been put in like:
However, pfsense format's the update URL like so
https://dynamicdns.park-your-domain.com/update?host=@.sub&domain=domain.com&password={password}&ip={ip}
Rather than coding logic to deal with subdomains, it would probably be much simpler to just make hostname and domain two separate fields when configuring the dynamic DNS page.
Files
Updated by Trel S almost 10 years ago
Formatting removed the {@} symbol
{@}.sub.domain.com
Updated by Trel S almost 10 years ago
- File pf_nc2.jpg pf_nc2.jpg added
A few more pieces of information
In this scenario, the subdomain is being pointed at namecheap's dynamic DNS not the main domain.
The easiest way I could see to allow for all these scenarios while not breaking any old ones is what in my mockup (being attached).
If both boxes are filled in, assume the user entered it right and use as is.
If only the one is filled in (which would coincide with the existing box) use the logic currently preset.
Updated by Chris Buechler almost 10 years ago
- Status changed from New to Confirmed
- Target version changed from 2.2.1 to 2.2.2
- Affected Version changed from 2.2 to All
Updated by Chris Buechler over 9 years ago
- Target version changed from 2.2.2 to 2.2.3
Updated by Bipin Chandra over 9 years ago
rather than having to modify gui and the xml values separately, its better to modify the logic such that u consider only the first part as host and the remaining as domain
eg: host.some.domain.com currently just takes domain.com as domain and the earlier part as host unless its a .uk domain in which some.domain.uk is considered a domain
so just one line of code will take host as hostname and some.domain.com as domain which can solve this easily
Updated by Bipin Chandra over 9 years ago
easy fix would be to edit the /etc/inc/dyndns.class file on line 537
replace
$domain_part_count = ($dparts[count($dparts)-1] == "uk") ? 3 : 2;
with
$domain_part_count = count($dparts)-1;
Updated by Jim Pingle over 9 years ago
Modifying that test would break other domains that function correctly now. That may be an "easy fix" for this specific case but it would break others in the process.
Updated by Trel S over 9 years ago
But that would then break in scenarios such as
parta.partb.domain.tld
"parta.partb" is a valid A record. Using the logic you said, there would be no possibility of updating that. It would try to update the A record for "parta" at the domain "partb.domain.tld" which is not an existing A record.
An example case here
do an NS lookup on this: parta.partb.raidio.co
The A record is for parta.partb NOT parta
Updated by Trel S over 9 years ago
The safest solution would be the two input boxes to allow the user to define how much is the host name, and how much is the domain.
It allows for all scenarios.
Updated by Jim Pingle over 9 years ago
Trel S wrote:
"parta.partb" is a valid A record. Using the logic you said, there would be no possibility of updating that. It would try to update the A record for "parta" at the domain "partb.domain.tld" which is not an existing A record.
That's not the problem. There are cases when the domain has more than two parts, specifically the case in the test with .uk, so the domain is domain.co.uk for example, not just domain.com.
Having separate input boxes is the safest method, perhaps even just co-opting the "username" field since it is unused with Namecheap, but the logic would still need to be carefully crafted so it does not break existing users.
Updated by Trel S over 9 years ago
There are cases when the domain has more than two parts, specifically the case in the test with .uk, so the domain is domain.co.uk for example, not just domain.com.
It looks like both of cases we mentioned would break if it just uses the left most part automatically.
Updated by Bipin Chandra over 9 years ago
well then the current logic uses 3 parts when on domain.co.uk whereas namecheap has other domains with 3 parts like x.com.sg, x.net.pe, com.pe etc etc so if any1 would be using those for dyndns then again it wouldnt work so i believe if we follow the 3 part domain for .uk then it would be meaningful to do so for all other such domains that namecheap provides or the other method is to have a separate hostname box
Updated by Trel S over 9 years ago
The main problem isn't if the domain is 2 or 3 part. It's that hard coding the number of parts breaks it for anything either non-standard (such as the "parta.partb" as a single A record) or anything over the hard coded parts.
For example, if you hard code it to 3 parts, how would it handle "suba.subb.subc.domain.co.uk"?
Anything hardcoded will have to make assumptions that will break anything that doesn't meet them.
The only option that allows for any possible case is the separate boxes which lets the user define which part is the host and which is the domain.
Updated by Bipin Chandra over 9 years ago
one easy way this could be done is, add the extra box but store the values of both in the same field in the xml but just add a | or ; or any such character to separate them, later can just find that split it again.
Updated by Chris Buechler over 9 years ago
- Target version changed from 2.2.3 to 2.3
Updated by Jim Pingle almost 9 years ago
- Status changed from Confirmed to Feedback
- % Done changed from 0 to 100
Applied in changeset 6635aa0f6c7a166a56a92ea2492930a67e825ce1.
Updated by Chris Buechler almost 9 years ago
- Status changed from Feedback to Resolved
Looks good, works.