Assigning a Domain Name to an AWS EC2 Instance

 Assigning a Domain Name to an AWS EC2 Instance via Elastic IP



Prerequisites:

Before we proceed, ensure that you have the following prerequisites:

  1. An active Amazon Web Services (AWS) account.

  2. An EC2 instance running and accessible.

  3. A registered domain name (e.g., example.com) with a domain registrar.


Step 1: Allocate an Elastic IP

  1. Go to the AWS Management Console and navigate to the EC2 Dashboard.

  2. From the navigation bar, click on “Elastic IPs” under “Network & Security.”

  3. Click on “Allocate new address” and choose “Amazon’s pool of IPv4 addresses.”

  4. Click on “Allocate” to create a new Elastic IP.


Step 2: Associate the Elastic IP with your EC2 Instance

  1. From the Elastic IPs list, select the newly allocated Elastic IP.

  2. Click on “Actions” and choose “Associate IP address.”

  3. In the “Associate Elastic IP address” dialog, select your EC2 instance from the drop-down menu.

  4. Click on “Associate” to link the Elastic IP with your EC2 instance.


Step 3: Update DNS Records with your Domain Registrar

  1. Log in to your domain registrar’s website (where you registered your domain).

  2. Locate the DNS management settings for your domain.

  3. Add an “A” record with a blank or “@” hostname, pointing to the Elastic IP address you just associated with your EC2 instance.

  4. Save the changes to update your DNS records.

Done


After updating your DNS records, it may take some time for the changes to propagate across the internet. DNS propagation typically takes a few minutes to several hours, depending on various factors such as TTL (Time to Live) settings and caching.


Post a Comment

0 Comments

Visual Studio