How to add a subdomain pointing to IP of EC2 instance in AWS where the domain is pointing to the IP of the machine of some other hosting provider?

这一生的挚爱 提交于 2020-01-24 00:44:08

问题


Here is the situation -

  1. I have my domain name xyz.com purchased from godaddy which is pointing to the website IP hosted by wix.com. 2 nameservers provided are of wix.com i.e. - ns2.wixdns.net & ns3.wixdns.net.
  2. I have another website which is hosted in AWS EC2 instance with some IP say XX:XX:XX:XX

I want to create a subdomain sub.xyz.com which should point to the IP(XX:XX:XX:XX) of my AWS EC2 instance without affecting the main domain pointing to the website created through wix.com.

Things I did, but did not work -

  1. I tried to contact godaddy for this purpose but they said it has to be done through AWS
  2. Tried to use subdomain option on godaddy and created a subdomain record for sub.xyz.com for the IP address of the EC2 instance
  3. Checked on internet and got some articles stating use of Route 53 on AWS. I tried to create one hosted zone file with xyz.com domain name but it created 4 new nameservers. Then I created a record set for this using -

name = sub.xyz.com,

record type = A-IPv4 Address,

TTL=300,

Value = XX:XX:XX:XX (IP of EC2 instance),

Routing policy = Simple

Route 53 provided 4 new nameservers which I think if I update on godaddy then it will not point domain name xyz.com to the website hosted by wix.com

I do not have much knowledge about AWS and domain/subdomain routing.


回答1:


Create sub.xyz.com A record in Wix DNS.

As commented by - Dusan Bajic




回答2:


After trying and as commented by Dusan above, creating 'A' record for "sub.xyz.com" in WIX resolved the issue.



来源:https://stackoverflow.com/questions/45101261/how-to-add-a-subdomain-pointing-to-ip-of-ec2-instance-in-aws-where-the-domain-is

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!