Hosting a subdomain without the main domain

spiderwebs

Registered
Apr 20, 2020
1
0
0
UK
cPanel Access Level
Website Owner
Hi All,

(TL;DR) To summarise, I'd like the following
primary.com --> cloud host provider (ip: 11.22.33.44) - works!
examplea.com --> cloud host provider (ip: 11.22.33.44) - works!
dev.examplea.com --> cloud host provider (ip: 11.22.33.44) - works!
exampleb.com --> AWS EC2 instance (ip: 99.88.77.66) - works!
dev.exampleb.com --> cloud host provider (ip: 11.22.33.44) - doesn't work!

The long explanation...

I have a some hosting using cpanel along with a free domain that came with it primary.com hosted from /public_html

I also have an addon domain hosted at another registrar (examplea.com) using their nameservers.
I updated the A Records for @ and * to point to the shared ip of my hosting (ip: ).
I also updated /etc/ips.remotedns to include both ips of the domains nameservers.
I have configured examplea.com hosted from /examplea.com.

I can access both primary.com and examplea.com and their respective website is displayed.
I can create the subdomain dev.examplea.com and that is hosted from /dev.examplea.com and is also accessible via the web.

Here's where my problem starts.

I also own one further domain exampleb.com which uses the same nameservers as examplea.com.

exampleb.com's A records currently point to an aws server (ip: ) which is serving as the web host for that domain and I'd like to keep it that way.
I would like to create a subdomain called dev.exampleb.com and host this at the hosting for primary.com but leave exampleb.com pointing to AWS
So i have created the A record dev and pointed it to the share ip of my hosting.

If I use add subdomain, my tld exampleb.com is not an addon domain so that won't work
So I am trying to add dev.exampleb.com as an addon domain instead, but I cannot seem to get this to work.

Cheers,
Matt
 
Last edited by a moderator:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,259
313
Houston
Hello,

Is DNS for exampleb.com hosted at AWS? If so did you create the A record for dev.exampleb.com there? IT needs to be done where DNS for the domain is hosted in order for it to resolve.

dev.exampleb.com could be added as an addon domain for the examplea.com account, you'd just need to ensure that it correctly points to the examplea.com account's IP address.

You can confirm the IP address it points to by running something like the following from an unassociated server (Not the AWS or Cloud Host server)

Code:
dig a dev.exampleb.com