Use in AWS a domain that you bought in GoDaddy
If you own a domain name, you can use Route 53 to resolve it to your environment. You can purchase a domain name with Amazon Route 53, or use one that you purchase from another provider. To use a custom domain name, first create a hosted zone for your domain. A hosted zone contains the name server and start of authority (SOA) records that specify the DNS hosts that will resolve requests for your domain name.
(1) To create a hosted zone in Route 53
- Open the Route 53 console.
- If you get to the Route 53 console’s landing page shown in the following image, choose Get started now under DNS management.
4. Choose Hosted Zones.
5. Choose Create Hosted Zone.
6. For Domain Name, type the domain name that you own. For example: example.com.
7. Choose Create.
Next, add a record to the hosted zone that resolves your domain name to your environment. When an Route 53 DNS server receives a name request for your custom domain name, it resolves to the elasticbeanstalk.com subdomain, which resolves to the public DNS name of your Elastic Load Balancing load balancer, which relays requests to the instances in your environment.
Note
In a single-instance environment, the elasticbeanstalk.com subdomain resolves to an Elastic IP address attached to the instance running your application.
If your environment doesn’t have a regionalized subdomain, create a CNAME record instead.
(2) To add a CNAME record in Route 53
- Open the Route 53 console.
- Choose Hosted Zones.
- Choose your hosted zone’s name.
- Choose Create Record Set.
- For Name, type the subdomain that will redirect to your Elastic Beanstalk application. For example: www.
- For Type, choose CNAME — Canonical Name.
- For Value, type the domain name of your Elastic Beanstalk environment. For example:example.elasticbeanstalk.com.
- Choose Save Record Set.
DNS records take up to 24 hours to propagate worldwide.
If you registered a domain name with another provider, register the name servers in your Route 53 hosted zone in the domain configuration of Goddady. When your provider receives DNS requests for your domain name, it will forward them to the Route 53 name servers to resolve the domain name to an IP address. Look for a setting called Nameservers, or check your provider’s documentation.
The Route 53 console displays the list of name servers for your hosted zone in an NS record on the Hosted Zones page and this are the name servers that you need to add in Godaddy to the DNS management of your domain.
(3) To register the name servers in your Route 53 hosted zone in the domain configuration in Godaddy
- Go to godaddy.
- Go to “Manage domains”.
- Click on the domain that you want to use.
- In the “Nameservers” section click on the button “Change”.
- Delete the nameservers from godaddy and add the name servers in NS Record in the Hosted Zone from AWS Route 53 related to your Elastic Beanstalk environment.
- You need to wait some hours for this changes to take effect.