How To Point or Map a Domain Name to AWS EC2 Server Instance

Bibin Wilson
Bibin Wilson
point map domain name aws ec2 server
Table of Contents
Table of Contents

In this blog, you will learn to point domain name to ec2 instance using the step by step guides.

Map a Domain Name to AWS EC2 Server

If you bought a domain name from providers like Godaddy, Bluehost, Namecheap, etc, other than AWS Route53, you might have their own name server configured in the DNS settings.

Now that you have your website on the AWS EC2 instance, mapping the domain name to the EC2 instance can be done in two ways.

  1. Mapping A record of the DNS records to an EC2 IP address (ec2 elastic IP).
  2. Create a Hosted Zone in Route 53 and map the domain address. (Will cost you $0.53 /month per hosted zone)

Method 1: Mapping Domain Name Using A Record

The easiest option is to map a domain name to an ec2 instance is by adding the elastic IP of the instance as an A record in the DNS settings.

Here is an example of an A record-setting on Godaddy.

Adding A record as ec2 elastic IP address.

Method 2: Mapping Domain Name Using Route53

Follow the steps carefully for setting up the domain name using Route53.

Note: Back up your current DNS file of your domain name providers. Also, make note of any custom DNS records that points to other mail servers.

Step 1: Head over to the AWS management console.

Step 2: Under services --> Networking, find Route 53 service and navigate to the Route 53 page.

Step 3: Click the "create hosted zone" option.

route53 hosted zone creation

Step 4: Click the "Get started" option under DNS management.

route53 get started

Step 5: Click the "create hosted zone" option and enter your domain details. For example, if your domain name is example.com, provide example.com in the domain name text box. Comment is some arbitrary description for your hosted zone. Leave the "type" as "public hosted zone"

hostedzone-domain-name

Step 6: Once the hosted zone is created, you can see four Nameserver details in the NS row as shown below.

AWS Name servers Route53

Step 7: Replace the existing Nameserver entries in your domain name provider with the AWS NS values from your hosted zone. The DNS changes will take up to 48 hours to get propagated all over the world. Mostly you will see the changes in a short time.

Step 8: Create an A record using the "create record set" option in route53 and assign the elastic IP of your ec2 instance which hosts your website. This will point the domain name to your website.

Conclusion

In this blog, I have added two methods to point a domain name to an ec2 instance.

For the production server, make sure you add an elastic IP to the ec2 instance and use it with the domain name settings.

Leave a comment below or contact admin@comtechies.com for more help.



Great! Next, complete checkout for full access to ComTechies - Become an SEO & Marketing Expert
Welcome back! You've successfully signed in
You've successfully subscribed to ComTechies - Become an SEO & Marketing Expert
Success! Your account is fully activated, you now have access to all content
Success! Your billing info has been updated
Your billing was not updated