How to host subdomain on a different server than the main domain?

PeteS

Well-Known Member
Jun 8, 2017
390
88
78
Oregon
cPanel Access Level
Root Administrator
It's definitely an issue, but I'm trying to understand the background of what led to this setting being necessary on a Solo account. Can you get me a summary of what led to this need just so I can make sure I'm reporting things correctly to the devs?
Scenario:
A company has two websites: main.com and unknown.com, in different data centers, and they are Solo licenses.

They want a support portal for main.com that is available even if the main.com is not. They don't want to have to say "If main.com is down, report it at support.unknown.com." so this allows support.main.com will be available even if main.com is not.

Does that make sense?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Okay, one last item. I did confirm that "Allow Remote Domains" is present on a Solo-licensed machine, but I'm not sure how the Allow cPanel users to create subdomains across accounts or Allow WHM users to create subdomains across accounts tools would be helpful in this situation, since you can only have one cPanel account. That tool isn't smart enough to detect a DNS cluster and deal with anything related to that.
 

PeteS

Well-Known Member
Jun 8, 2017
390
88
78
Oregon
cPanel Access Level
Root Administrator
Okay, one last item. I did confirm that "Allow Remote Domains" is present on a Solo-licensed machine, but I'm not sure how the Allow cPanel users to create subdomains across accounts or Allow WHM users to create subdomains across accounts tools would be helpful in this situation, since you can only have one cPanel account. That tool isn't smart enough to detect a DNS cluster and deal with anything related to that.
Correct, and you had me check for that in the file as well. It makes logical sense to me also that the remote domain setting would be the issue. But from the wording of it, it seems like "Allow cPanel users to create subdomains across accounts" would also apply. Interestingly, ONLY the latter applies, as xpy-xpy suggested:

In my case the solution to a similar issue was to check "Allow cPanel users to create subdomains across accounts" in WHM/ Tweak Settings before attempting to setup sub.example.com in Cpanel.
I would think based on the text names of each that BOTH would be required to be set on, but that's not what I experience. I tested again now, by attempting to set up an ADDON subdomain on a Solo account server, for a different domain/user on a non-Solo server.

This fails:
allowparkonothers=0
allowremotedomains=1

This works:
allowparkonothers=1
allowremotedomains=0

No other settings were changed from default in Tweak setting - Domains.

Seems like maybe the interactive logic between these for this functionality is not behaving as intended.

Can you duplicate this behavior?
 

PeteS

Well-Known Member
Jun 8, 2017
390
88
78
Oregon
cPanel Access Level
Root Administrator
Just to confirm I'm doing this right, I need to create my one domain in Solo, then setup an addon domain that isn't pointed to the server, correct?
Yes, I think you are saying the same thing as I am. See below...

I should add that both servers are in the same DNS cluster.

Non-Solo server hosts example.com as normal.

Solo server hosts domain.com as normal.
Add an addon of sub.example.com in domain.com's account on the Solo server (it will set DNS to point to the Solo server's IP in the zone for example.com)
 

PeteS

Well-Known Member
Jun 8, 2017
390
88
78
Oregon
cPanel Access Level
Root Administrator
I did some testing on my end, and so far I haven't been able to reproduce this issue.

Since you have an environment where this is happening could you create a ticket with our team so we can check it out?
Wait... no ticket... instead, let's be clear on which server we are making the setting changes.

I was making all these setting changes on the server creating the subdomain (the Solo server). But I re-read the description for allowremotedomains and it sounds like it allows OTHER servers to set up a subdomain for a domain it serves.

"This setting allows the creation of parked domains (aliases) and addon domains that resolve to other servers."

That's what I see in testing. If I set allowremotedomains=1 on the main domain's server it allows the other (Solo) to set up a subdomain for remote the main domain, and no setting changes on the Solo server are needed. Also if I reverse the scenario (setting up a subdomain on a multi account server, off a main domain on a Solo server) the necessary setting (allowremotedomains) IS available on the Solo server.

So it seems that allowremotedomains works as expected, and does not take into account whether servers are in a cluster, in that it allows or prevents ANOTHER server from creating a subdomain for an account it hosts.

BUT... consider how allowparkonothers works when I tested it on DNS clustered servers. You can set up a subdomain for a domain on a another server by setting allowparkonothers=1 on the server creating the subdomain, even though allowremotedomains=0 is set on the other (main domain's) server. Setting allowparkonothers=0 on either/both has no effect in preventing creation of subdomains between the two servers, if allowparkonothers=1 is set on the server creating the subdomain. (I tested this both directions and it holds true.) I tried this for a remote domain NOT in the DNS cluster, and that didn't work (as expected).

Not sure if we should call this a bug or a feature. ;) I assume allowparkonothers was meant to allow this where the scenario is between accounts on the SAME server.

"This setting allows a cPanel user to create an addon domain or subdomain on a domain that another user owns. For example, if a user owns the example.com domain, another user could create the store.example.com subdomain."

Setting allowparkonothers=1 on the server creating the subdomain also allows it create subdomains on OTHER servers in the DNS cluster even though allowremotedomains=0 is set. I assume because they are not considered remote since they are clustered, and may have been by design. If so, then it would still make sense for allowparkonothers and allowwhmparkonothers to be available on a Solo server. It allows the operation to be completed from ONE server, and it's a lesser concern IMO than opening up allowremotedomains. This would be especially true if all the accounts in a cluster were controlled by the same company/person, and they might want to leave allowparkonothers enabled, but definitely wouldn't want leave allowremotedomains enabled since it would allow any server to create a subdomain for a domain it hosts. (Or is it only effective within a cluster? This I couldn't test.)

If I am understanding this correctly, it seems allowremotedomains ignores DNS clustering, and allowparkonothers takes it into account, which seems a little odd.
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
I think we're giving these features too much credit and reading into things a bit at this point.

allowremotedomains just checks, locally, to ensure the DNS points to the server you're creating the account on. It doesn't know about external servers or anything like that. The same is true with allowparkonothers - it's a local check.
 

PeteS

Well-Known Member
Jun 8, 2017
390
88
78
Oregon
cPanel Access Level
Root Administrator
I think we're giving these features too much credit and reading into things a bit at this point.

allowremotedomains just checks, locally, to ensure the DNS points to the server you're creating the account on. It doesn't know about external servers or anything like that. The same is true with allowparkonothers - it's a local check.
Fair enough, but does locally mean only the server it is set on, or the DNS cluster?

How is it that setting allowremotedomains=1 on another server (in the DNS cluster) allows me to create a subdomain off of the domain hosted on that other server (and has no effect if set on the server creating the subdomain)?

Why does setting allowparkonothers=1 on the server creating a subdomain off of a domain hosted on another server (in the DNS cluster) allow that without allowremotedomains=1 being set?

Without setting one of these settings as I detailed above, cPanel knows the base domain is on a different account than the account creating the subdomain. And the error is always about account/domain ownership, and never about it being remote, and this holds true for either setting in any combination.

I can let this go, with the knowledge of what does and doesn't work in each setting's case, but I feel like either the docs need to way more detailed and clear, or things have changed with DNS clustering being added and the doc and/or functionality aren't quite up to date.

Thanks for messing with this with me.
 

PeteS

Well-Known Member
Jun 8, 2017
390
88
78
Oregon
cPanel Access Level
Root Administrator
I honestly have no idea. I think we've reached the point of needing a ticket to do some more investigation though :D
Ok... I have this sorted and don't feel there is an issue with any of my servers, but in the "the interest of science" I'll do it. :D

But I'm going to put it off a few days until a better time. I'll report back what I find out...
 
  • Like
Reactions: cPRex