Use sub-domain of domain in another server

0

I have two hosting services. One is already in use and has domain example.com. It also has a sub-domain called order.example.com.

Second hosting service is under Amazon (EC2).

How can I use order.example.com sub-domain in Amazon virtual hosting service?

So when user goes to the example.com website and clicks the order.example.com link it redirects to Amazon server, but keeps the url as it is.

I want it to feel like that user hasn't redirected anywhere from example.com. Can I assign same domains to multiple servers?

Jaakko Uusitalo

Posted 2018-05-09T11:08:22.677

Reputation: 103

You need to know the ip address of your amazon hosting, then set the DNS of domain.example.com with A record to point to the ip address. Then on the amazon hosting, add a domain, and choose order.example.com. Given that I don't have an amazon hosting, I don't know the exact screens, and that's why this is a comment, not an answer. – LPChip – 2018-05-09T11:49:58.293

@LPChip Okay, ill try that! – Jaakko Uusitalo – 2018-05-09T11:55:43.017

Answers

1

I want it to feel like that user hasn't redirected anywhere from example.com. Can I assign same domains to multiple servers?

But it's not the same domain. The subdomain is completely independent in terms of where it points (and doesn't inherit anything from its parent domain).

So the answer is yes, you can do that, and you do not need to do anything special – besides actually creating the subdomain in DNS (with a standard A/AAAA or CNAME record).

(I don't know how EC2 works, but generally use A/AAAA if the EC2 server has a completely static IP address, or CNAME if Amazon gives you a special hostname to alias to, like many CDNs do.)

user1686

Posted 2018-05-09T11:08:22.677

Reputation: 283 655

I want to vote this up, but I'm stopped in my tracks. I feel like this answer is incomplete, even though it is correct for what is already written. – LPChip – 2018-05-09T12:06:49.037

I usually focus on why the question had to be asked in the first place... meanwhile feel free to write the other half in your own post. – user1686 – 2018-05-09T12:10:21.267

Your edit seems much better. +1 – LPChip – 2018-05-09T12:14:07.070

I created New Record A with Amazon public ip from example.com control panel. – Jaakko Uusitalo – 2018-05-09T12:14:18.033