Project

General

Profile

Actions

Feature #4366

closed

Namecheap Dynamic DNS updates fail on subdomain formatted domains

Added by Trel S almost 10 years ago. Updated almost 9 years ago.

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

100%

Estimated time:
Plus Target Version:
Release Notes:

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.


Files

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

Updated by Trel S almost 10 years ago

Formatting removed the {@} symbol

{@}.sub.domain.com

Actions #2

Updated by Trel S almost 10 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.

Actions #3

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
Actions #4

Updated by Chris Buechler over 9 years ago

  • Target version changed from 2.2.2 to 2.2.3
Actions #5

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

Actions #6

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;

Actions #7

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.

Actions #8

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

Actions #9

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.

Actions #10

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.

Actions #11

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.

Actions #12

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

Actions #13

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.

Actions #14

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.

Actions #15

Updated by Chris Buechler over 9 years ago

  • Target version changed from 2.2.3 to 2.3
Actions #16

Updated by Jim Thompson about 9 years ago

  • Tracker changed from Bug to Feature
Actions #17

Updated by Jim Thompson almost 9 years ago

  • Assignee set to Jim Pingle
Actions #18

Updated by Jim Pingle almost 9 years ago

  • Status changed from Confirmed to Feedback
  • % Done changed from 0 to 100
Actions #19

Updated by Chris Buechler almost 9 years ago

  • Status changed from Feedback to Resolved

Looks good, works.

Actions

Also available in: Atom PDF