Point multiple domains to one cPanel account

jbcams

Registered
Sep 14, 2011
2
0
51
cPanel Access Level
Website Owner
This was posted on Stackoverflow but I think I got drowned out pretty quickly so I'm hoping that someone here has experience with this:

I am trying to figure out the best way to have multiple domains point to one cPanel account and I'm not entirely sure of the reasons for some of the technical aspects behind it so I'll set up my current scenario:

Scenario

I will call the main account 'MAIN' and the external domain one that points to it 'OUTSIDE' just for sake of clarity.

I have a server with multiple IPs associated with it. There are a couple of cPanel accounts that currently use a single IP. If I create the account 'MAIN' using that already used IP, then the 'MAIN' domain works fine (obviously) but the 'OUTSIDE', which is also pointed to that IP with NO account associated just gives me the 'cgi-sys/defaultwebpage.cgi' (again, not very surprising).

If I set up 'MAIN' account on its own IP and then point 'OUTSIDE' to that IP (still no account associated with 'OUTSIDE'), 'OUTSIDE' brings up my simple 'MAIN' index page (which echos nothing more than the URL that is accessing it).

For the sake of comparison, I want to do something like the wildcard subdomain except with other domains

Questions

Is the only reason that my server renders 'MAIN' when accessed from 'OUTSIDE' because it is the only account on that IP?

Is this a reliable way of making this work or am I oversimplifying and asking for trouble?

I guess, to go along with the first question, should this even be working the way I have it set up?


I really appreciate any guidance.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

Have you considered making the additional domain name a parked or addon domain name via cPanel?

Thank you.
 

jbcams

Registered
Sep 14, 2011
2
0
51
cPanel Access Level
Website Owner
Hi Michael, that's awesome. I guess that pretty much does what I need. I've been looking around for solutions to make this more automated and was wondering if there is anything in the cPanel API that would allow me (through php script) to automatically add a name into the parked domain list.

In regards to the quick and dirty way I did it before, is there anything inherently wrong with it? I have tested from a couple of external domains and, as long as the main account domain is on its own IP, it seems to work ok.

Thanks so much for your help.

Regards,
Jon
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Documentation on the parked domain API functionality is available here:

Park Domain API

In regards to the quick and dirty way I did it before, is there anything inherently wrong with it? I have tested from a couple of external domains and, as long as the main account domain is on its own IP, it seems to work ok.
There is nothing wrong with that method, however note that it will not work when using a shared IP address. The reason it works in the scenario you described is because a dedicated IP address will load the contents of the website assigned that IP.

Thank you.