circuit

The Simple Way to Connect AWS EC2 Instance with Your Domain Name

Explore the easiest way to bind EC2 IP with your Domain Name to host your content.


I am writing this article containing only two steps, using that you will be able to connect your domain name with your Amazon Web Service — EC2 server /host and so you can access your hosted content from your EC2 instance publicly/Globally. Generally, this life hack is mostly used by last year's engineering university students to deploy and showcase their creative projects.

tl;dr

  1. Allocate the elastic IP
  2. Connect it with your Domain name using the DNS manager of your registrar account (Registrars like GoDaddy, BigRock, etc.).

Let me explain more:

1. Generate and Assign the Elastic IP for the EC2 instance you are integrating.

  • Sign up and sign in with your AWS account, search for an EC2 instance in the AWS management console through your sidebar, go to the EC2 Instance page.
  • Search for the Elastic IPs page and tap/click on the “Allocate new address” button.
  • After that, Click on the Allocation button. Once you allocate the IP Address, you need to bind it with your AWS EC2 Instance, otherwise, AWS may charge some amount as unbounded and not assigned allocated IP.
  • Go to your AWS and console and then EC2 Instances screen, Right-click on the row of the newly created elastic IP, and click on the Associate address.
  • Select the relevant EC2 instance you are integrating.

2. Connect your allocated elastic IP with your domain registrar.

  • Sign in with your registrar's account (for example, GoDaddy), search and click on “Manage DNS”, “Setup domain name Server” or “DNS manager” of the website you want to connect to EC2 instance. On different websites, they are providing the same functionality with different names. If you don't find the above name, search for how you can change your DNS address through your registrar's account.
  • Look for Name = host or @, Type = A, value =”some_ip_address”, replace this value to your EC2 elastic IP and set TTL = 1200 seconds (or minimum allowed TTL, it is TIME-TO-LIVE, which will take some time to make your changes effective on internet world) — This specified time will take time to reflect the changes sometimes depending on your host service provider.
  • To check where your changes are working fine or not, you can hit your domain name and port if applicable to your web browser's address bar.
  • You can also keep track of your A records, MX records, SOA parameters, NS records, etc. using Who.Is website. (visit the website and enter your domain name to see your record state)

Bingo! You did it. 👏

If you think that this article has helped you in any way, be sure to express your expressions in the comments.

References

  1. Amazon Web Services Documentation
  2. Learnings from my experience and simplifying the way to bind IP with any domain name.



Continue Learning