Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How redirect a domain to Amazon EC2 Machine?

I'm using EC2 of Amazon to host a website built in JSP :

http://ec2-50-17-144-64.compute-1.amazonaws.com:8080/p2p

And I bought this domain: www.p2pbrasil.com

How can I redirect www.p2pbrasil.com to my website in Amazon EC2 ?

When someone type www.p2pbrasil.com it redirects to http://ec2-50-17-144-64.compute-1.amazonaws.com:8080/p2p ?

like image 270
Valter Silva Avatar asked Apr 05 '11 15:04

Valter Silva


2 Answers

You need to do two things

  1. In the Amazon Web Service admin panel, create an elastic IP in the same region as your instance and associate that IP with your that instance (IPs cost nothing while they are associated with an instance, but do cost if not).
  2. Add a A record to the DNS record of your domain mapping the domain to the elastic IP address assigned in (1). Your domain provide should either give you some way to set the A record (the IP address), or it will give you a way to edit the nameservers of your domain.

If they do not allow you to set the A record directly, find a DNS management service like ZoneEdit, register your domain as a zone there and ZoneEdit will give you the nameservers to enter in the admin panel of your domain provider. You can then add the A record for the domain in ZoneEdit.

I only mention ZoneEdit because the basic service is free, you could also use Amazon route 53 or a similar pay-for service, if you preferred.

like image 186
Thomas the Tank Engine Avatar answered Sep 28 '22 05:09

Thomas the Tank Engine


Create an Elastic IP on the AWS Panel, then associate it to your instance.

Then use a DNS management service to add your domain and Ip address (Elastic IP), then on the domain provider panel add the DNS provided from the DNS management service.

I recommend EntryDNS which is actually free.

like image 30
René Michel Avatar answered Sep 28 '22 05:09

René Michel