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

skrl

Member
Mar 18, 2021
9
2
3
Kingston
cPanel Access Level
Website Owner
I have mydomain.com served from Host A (IIS). mydomain.com is developed with ASP.NET.

I need to serve a subdomain.mydomain.com from Host B (Apache). subdomain.mydomain.com will be developed with Drupal.

I thought all I would have to do would be to create an A record in my registrar's DNS nameservers to point to the public IP of the Host B, and that would be it, and I would be able to then proceed with my installation as soon as the DNS propagation would have finished. My Host B support team says that that would not work, although they haven't made it crystal clear why. They've said it's something to do with the virtual machine engine the WHM has been installed on to. Please kindly note that the Host B is a dedicated server, and I would expect there would be more flexibility in terms of available options.

I am mostly front-end oriented, and I need to better understand why that would be the case.

Would you happen to have available any resources I could spend time reading to better educate myself on this?

Any obvious insight at hand that I might be overlooking would be also really appreciated.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,918
608
273
cPanel Access Level
Root Administrator
Hey there! As far as the internet portion of the traffic, you are correct - you just need the A record where your DNS is hosted to point to the correct system.

However, you also need to have the correct entries setup on that webserver as well. For example, on a cPanel machine, you'd need to ensure the subdomain is created in cPanel or else Apache won't know where to serve the content from. Even though the DNS may be pointed properly, the webserver side still needs to exist so it knows how to handle that.

Maybe that is what they were getting at?
 

skrl

Member
Mar 18, 2021
9
2
3
Kingston
cPanel Access Level
Website Owner
Hey, thank you for your prompt input. So when the account for the subdomain is created, would that be all on the server side under regular configuration?

By the way should there be any problem whatsoever creating the cPanel account, and associating it with the subdomain.mydomain.com as the primary domain? Does cPanel really care if that domain name already exists or not? Or does it care whether it is pointed to a different host or not? To my knowledge it does not, but I just want to double check because I am at a point where I am doubting everything I think I knew...

The server hosts another installation as well. There's only one public IP, and zero dedicated ones. But I would not expect that to be a problem; when you purchase a shared hosting plan that is usually the case also, isn't it?

How do you generally go about doing such implementations as the one I am trying to achieve here? (edit: What settings should I ask them if they have set them up correctly?)
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
599
193
343
cPanel Access Level
DataCenter Provider
It's easy and we do this all the time:

  • On Server-A create mydomin.tld ( your IIS server)
  • On Server-B create subdomain.mydomain.tld (the cPanel server)
Then in your DNS you just need to create the "A" record to point subdoamin.mydomain.tld to the IP assigned in cPanel.

cPanel is perfectly happy to create the account as a sub-domain.
 

skrl

Member
Mar 18, 2021
9
2
3
Kingston
cPanel Access Level
Website Owner
It's easy and we do this all the time:

  • On Server-A create mydomin.tld ( your IIS server)
  • On Server-B create subdomain.mydomain.tld (the cPanel server)
Then in your DNS you just need to create the "A" record to point subdoamin.mydomain.tld to the IP assigned in cPanel.

cPanel is perfectly happy to create the account as a sub-domain.
So I should not need a dedicated public IP just for every individual cPanel installation. I just need a cPanel account for every installation, with subdomain.mydomain.com as my primary domain associated with this one account in this case. Then the A record goes in my DNS, and the rest should be taken care of by the cPanel and/or Apache; have I got it down right? No special back-end handling on behalf of Host B?

That is how I had everything in my mind to start with, but then my back-end support said it can't be done, or it wil not work, or it is not as easy and what not, and got me into doubts.