If you are looking for a simple guide to point “yourdomain.com” to your EC2 hosted application, then you are in luck. This is only applicable if you want to keep your domain on GoDaddy. Transferring a domain is another topic
This guide is meant to be a straightforward tutorial. Please refer to the official documentation for more in-depth details.
For purposes of this guide GoDaddy is the domain name provider. Similar setup might work on other domain name provider. The idea is the same.
AWS
- Sign in to your console > EC2 > Click on your EC2 instance.
- Update your “Security groups * Inbound Rules” to reflect the following. For port 443, only enable this when you have HTTPS setup and enabled
- Now go to Services > Route53 then click Create Hosted Zone Now that we have our hosted zone. Let’s create the record set.
- The NS records are already created. These are the records that you want to use and take to your registered domain. Take note of these.
GoDaddy
- With the NS record values copied, go to your GoDaddy DNS page and in the Nameservers section, change it to use “Custom” records. Adding them one by one, you should have a similar setup. OR If you CANNOT CHANGE but can add NS records, just add them one by one on the Records section.
- Take note that propagation may take a while (sometimes 24 hours). So just be patient if it doesn’t reflect right away.
Back to AWS
- Going back to AWS Route53 Dashboard, let’s create the following records.
- A - for www.yourdomain.com - pointing to your EC2 instance’s public IP, Name:
www.yourdomain.com.
, Value:xx.xxx.xx.xx
- A - ALIAS - Name:
yourdomain.com.
, Alias Target:www.yourdomain.com.
- CNAME (Optional) - a subdomain that points directly to another domain - Name:
google.yourdomain.com
, Value:www.google.com
- A - for www.yourdomain.com - pointing to your EC2 instance’s public IP, Name:
Now your setup is done. Remember that DNS propagation is not instant so you may have to wait for a while. If yourdomain.com
still doesn’t respond, check for updates and guides for Route53 and your domain name provider.
A good reference for this guide is this video from AWS Tutorial Series. Check it out!