Project

General

Profile

Feature #4366

Namecheap Dynamic DNS updates fail on subdomain formatted domains

Added by Trel S over 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Dynamic DNS
Target version:
Start date:
02/02/2015
Due date:
% Done:

100%

Estimated time:

Description

The domain in question is in the format
sub.domain.com

I need to update the record for this domain.
So, it's been put in like:
.sub.domain.com

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.

pf_nc2.jpg (53.9 KB) pf_nc2.jpg Trel S, 02/17/2015 01:38 PM

Associated revisions

Revision 6635aa0f (diff)
Added by Jim Pingle over 3 years ago

Change Namecheap dyndns to use split hostname and domain name fields. Upgrade existing entries automatically. Implements #4366
Code should be generic enough that if other DynDNS providers would work better with a separate domain field, they can pick up the feature without too much trouble.

Revision 4fe66748 (diff)
Added by Chris Buechler over 3 years ago

Fix dyndns breakage after changes on Ticket #4366

Revision b24a0251 (diff)
Added by Chris Buechler over 3 years ago

Fix ddns domain name Ticket #4366

History

#1 Updated by Trel S over 4 years ago

Formatting removed the {@} symbol

{@}.sub.domain.com

#2 Updated by Trel S over 4 years ago

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.

#3 Updated by Chris Buechler over 4 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

#4 Updated by Chris Buechler over 4 years ago

  • Target version changed from 2.2.2 to 2.2.3

#5 Updated by Bipin Chandra over 4 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

#6 Updated by Bipin Chandra over 4 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;

#7 Updated by Jim Pingle over 4 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.

#8 Updated by Trel S over 4 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

#9 Updated by Trel S over 4 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.

#10 Updated by Jim Pingle over 4 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.

#11 Updated by Trel S over 4 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.

#12 Updated by Bipin Chandra over 4 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

#13 Updated by Trel S over 4 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.

#14 Updated by Bipin Chandra about 4 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.

#15 Updated by Chris Buechler about 4 years ago

  • Target version changed from 2.2.3 to 2.3

#16 Updated by Jim Thompson over 3 years ago

  • Tracker changed from Bug to Feature

#17 Updated by Jim Thompson over 3 years ago

  • Assignee set to Jim Pingle

#18 Updated by Jim Pingle over 3 years ago

  • Status changed from Confirmed to Feedback
  • % Done changed from 0 to 100

#19 Updated by Chris Buechler over 3 years ago

  • Status changed from Feedback to Resolved

Looks good, works.

Also available in: Atom PDF