NameCheap domain name and Amazon EC2
In this tutorial, we will show you how to associate a NameCheap domain name to an Amazon EC2 instance.
In AWS
- Create an Elastic IP and point to the Amazon EC2 instance.
- Go to service Route 53, create a ‘A’ record and point to the Elastic IP.
- In Route 53, copy the Amazon NS (name server) urls.
In NameCheap
- Paste the Amazon NS urls into the NameCheap DNS settings.
In Summary
Request <==> NameCheap <==> Amazon NS <==> Route 53 <==> Elastic IP <==> EC2 Instance.
This DNS changes may take 24 hours to propagate.
1. AWS : EC2 and Elastic IP
1.1 After the Amazon EC2 instance is launched, both public IP and public DNS will be assigned automatically.
If this EC2 instance is “stop” and “start”, both public IP and public DNS will be changed. This is the reason to create an elastic IP and point it to an EC2 instance, because elastic IP will not change even if the instance is “stop” and “start”.
1.2 Create an Elastic IP :
- Clicks on the “Allocate New Address” button, a new elastic IP will be created automatically.
- Clicks on the “Associate Address” button, select the EC2 instance.
Done, the Elastic IP is associated with the EC2 instance.
Next, configure the DNS settings (Route 53).
2. AWS : Route 53 (DNS)
2.1 Go to service “Route 53”, create a hosted zone, two record set (NS and SOA) will be created automatically. Clicks on the “NS” type, copy the Amazon NS urls, later we need to put these urls in NameCheap.
Amazon NS urls
ns-396.awsdns-49.com.
ns-1143.awsdns-14.org.
ns-1676.awsdns-17.co.uk.
ns-879.awsdns-45.net.
2.2 Create two new “A” or “A – IPv4 address” records (root domain and www.domain) and point it to the Elastic IP.
3. NameCheap : DNS
3.1 Copy the Amazon name server urls and puts it into the NameCheap DNS settings.
Amazon NS urls
ns-396.awsdns-49.com.
ns-1143.awsdns-14.org.
ns-1676.awsdns-17.co.uk.
ns-879.awsdns-45.net.
3.2 In NameCheap, select the domain name, and clicks “Transfer DNS to Webhost” or “Domain Name Server Setup“, copy and paste the Amazon NS urls :
Done.
References
- Hosting a Web App on Amazon Web Services
- ServerFault : IP changed when EC2 instance stopped and started
From:一号门
Previous:Maven Display project dependency
COMMENTS