How to connect EC2 instance with GoDaddy Domain
In this tutorial, you'll learn about how to connect applications hosted on AWS EC2 with the Godday domain.
Currently, your application should be accessible from public IP or public DNS which available in EC2
As public IP or Public DNS provided by ec2 will keep always changing while you make stop/start or restart the instance, as we need to provide this IP address for connecting domain but if IP address change then it will stop working
So, to overcome this problem AWS provided an Elastic IP solution which provides static IP which won't change during server restart.
Steps -1: Create Elastic IP:
!)Go to your EC2 section and select your running instance
!!)From the left side, menu select Elastic IPs under Network & Security menu
!!!)Then click on the 'Allocate Elastic IP address' address button
!v) Click on Allocate button
v)Now you have allocated IP address, now you need to connect this created elastic IP with our EC2 instance, so select elastic IP and from Actions menu choose Associate Elastic IP Adress,
vi)Then select your running EC2 instance from the list and your instance will be associated with your elastic IP
Now go back to the EC2 instance list and select your running instance now you will be able to see your "Elastic IP addresses" in the details section, also Public IPv4 and Public DNS also will be changed, so now if you restart your instance your IP will not be changed.
Also, you can check with this IP as everything in the browser works properly by typing this IP in URL.
Step-2: Connect Domain using Route53:
!)Go to the services section and select Route53:
!!)Then click on ''Create Hosted Zone', add your domain name and comment as below, and click on the 'Create' button,
After creating the hosted zone, it will generate some records as below:
!!!)Now Click on Create Record Set and add record as below:
use your domain name and elastic IP in relative columns
It will create record A
Now add another record, as below:
!v)Select NS type record from records list and copy all values, as we need this to create nameserver in godday.
Connect with Goddy:
!)Login to godday and from dashboard select MyProducts option, then click on DNS button:
!!)Now choose 'I'll use my own nameservers' and add your nameserver which you copied from AWS and paste it one by one per line and save it.
That's All, After some time your domain will start work.