Back to Guides
AWSElastic IPDNSNetworking

Assign Static IP (Elastic IP) & Configure DNS Records

By default, AWS EC2 instances receive a dynamic IP that changes on reboot. This guide shows you how to assign a permanent Elastic IP and point your custom domain to it.

1

Allocate an Elastic IP

AWS calls static IP addresses Elastic IPs. Unlike standard public IPs, these persist even if you stop and start your instance.

  1. Log in to the AWS Management Console.
  2. Navigate to the EC2 Dashboard.
  3. In the left sidebar, under Network & Security, select Elastic IPs.
  4. Click the orange Allocate Elastic IP address button.
  5. Keep the default settings (Amazon's pool of IPv4 addresses) and click Allocate.

Success: You should now see a new IP address listed in the dashboard.

2

Associate IP with Instance

Now that you own the IP, you need to attach it to your specific running server.

  1. Select the newly allocated IP address checkbox.
  2. Click the Actions dropdown menu and select Associate Elastic IP address.
  3. In the Instance field, search for and select your running EC2 instance.
  4. (Optional) Check "Allow this Elastic IP address to be reassociated" if you plan to move it later.
  5. Click Associate.

Note: Your EC2 instance's previous public IP will be released immediately. If you were connected via SSH, your connection will drop, and you must reconnect using the new Elastic IP.

3

Configure DNS Records

To make yourdomain.com point to your server, you need to add an A Record in your DNS provider settings (e.g., Route 53, GoDaddy, Namecheap).

DNS Configuration (A Record)
TypeA
Name / Host@ (or blank)
Value / Target[Your Elastic IP]

If you also want www.yourdomain.com to work, create a second record:

TypeCNAME
Name / Hostwww
Value / Targetyourdomain.com

⏳ Propagation Time

DNS changes can take anywhere from a few minutes to 48 hours to propagate globally. You can verify your setup using tools like whatsmydns.net.