Domain names are a great way for people to uniquely identify internet services and resources. Many people assign these text-based labels as a way to easily memorize resources rather than the numerical addresses used in the Internet protocols.
This will be a guide to assist in assigning a unique domain to an EC2 instance hosting an API, personal website, etc.
Note: This guide will be keeping costs to a minimum so paid domains and domain registering on AWS Route 53 will not be used. Here is a link to getting started with Route 53, a great domain registering alternative for developers with a larger budget.
Getting a Free Domain
For those on a tight budget or just simply starting to learn about domains, there are plenty of ways to acquire a domain for free. This guide will be using Freenom.com, a popular free domain server.
Once you’ve selected a name and went through all of checkout, view your newly acquired domain.

Keep this page open, it will be used in the coming steps.
Pointing Domain To AWS EC2 Instance DNS
Head over to the AWS console and navigate to the desired EC2 instance. It’s very important that the instance already has a web server/LAMP stack configured before proceeding.
Now navigate to Route 53.
As previously stated, Route 53 will not be used for its domain registering services (due to costs) but will be used to create a hosted zone for the new domain.
- Select create hosted zone and name it accordingly to the domain name.
- Also set the zone type as public hosted zone.
-
Finalize and save changes.

-
Once the hosted zone is created, press Create Record Set and create two A records (for www and one with an alias target of the new domain) with the IPv4 address of the EC2 instance.
- Navigate back to the My Domain section of freenom and select *Manage Domain
- Go to the dropdown and select: Management Tools –> Name Servers –> Use custom nameservers
- Attach the 4 nameserver values found in the recently created hosted zone and save the changes.

Now search the domain name on a search engine and check out the renamed site!
