Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

amazon ec2 - How to link godaddy domain with AWS Elastic Beanstalk environment?

I'm running into this problem trying to link my Godaddy domain with an AWS Elastic Beanstalk instance. I found a lot of documentation on how to link an EC2 instance with a domain on Godaddy but not for Elastic Beanstalk instance. So I ended up with this URL: www.MY_SITE.elasticbeanstalk.com

Here is what I did for an EC2 instance:

  1. I updated the Nameservers on my Godaddy domain with the ones from my Route 53 Hosted Zone.
  2. I created a new Elastic IP on the EC2 console.
  3. I went back to Godaddy and updated the DNS A @ field from their DNS Manager, with the EC2 Elastic IP one.
  4. You normally have to wait 1h to 48h and it should work.

How can I do the same for a AWS Elastic Beanstalk instance, not an EC2 one? I can't see the instance I created from my EC2 console in order to link it to an Elastic IP.

Hope this is clear enough.. Any help?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

No need to create a CNAME or do any forwarding - this is bad from the point of SEO and not recommended by Amazon. Even you should not point a record to IP directly - it will cause a lot of troubles in the future because IP can be changed any moment.

The most elegant way is to migrate DNS service from GoDaddy to Route 53. You still will be with GoDaddy, but handling requests for your site will be on Amazon's side.

Here is what you need to do:

  1. Create a new Hosted Zone for your site in Route 53 console: enter image description here

  2. Open newly added domain name, find NS record and copy servers: enter image description here

  3. In GoDaddy's Domain Manager export records via "Export Zone File (Windows)".

  4. Import those records to Route 53 ("Import Zone File" button).

  5. In GoDaddy's Domain Manager set custom DNS nameservers, obtained on the 2nd step: enter image description here

Migrating might take some time (even days). Now you can link you domain with your Elastic Beanstalk site. To do so select/create proper A record type in Route 53 and set Alias for it: enter image description here

Hope it helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...