I want to use Route53 to give our organisation a standardised set of domain names for our dev environments (e.g. website2.theclient.development.com).

I can create a new sub domain in a Route53 hosted zone and associate it to the public IP or DNS for an EC2 instance. However, when an EC2 instance is shutdown and started up the public IP and DNS change and I have to update the Route53 A name.

I don't want to use a static IP for each EC2 instance. Is there another way to tackle this so that a domain name in a hosted zone is permanently associated with an EC2 instance?


If you do not want to use Elastic IP's as suggested by @Ondra, you can instead automate the process of re-associating the newly assigned IP addresses to the Route53 CName records.

Here is a blog post that gives one way:

We have a situation where we use a lot of transient EC2 instances that are part of an integrated set of demonstration machines. They all refer to each other by DNS name that we have set up in a Route53 domain within AWS. For cost reasons, we shut these machines down any time we are not using them. The problem is, every time we boot the machines, we have to go through the grief of re-associating the Route53 CNAMES with the newly-reacquired public DNS and IP entries. Doing this manually is kind of a pain and my nature is always to automated this with command line scripts....


  • Nice blogpost. It's good you can use it even for private IPs, but little drawback is you have to install another utility on servers. My option (EIP or CloudFormation) is working purely with aws infrastructure and servers don't even know about it. Nov 11 '15 at 11:33
  • And it works only on some OS - Amazon linux, Ubuntu and RHEL afaik. Nov 11 '15 at 11:35
  • Yes, the blogpost is for Linux boxes, but the concept is the same no matter the OS; use the API to re-assign the Route53 records each time the machine boots. EIP is a good option if you only have a small number of boxes to manange, but you will very quickly run out of EIP's since you are limited to 5 unless you apply for more.
    – EJB
    Nov 11 '15 at 12:27
  • Thanks. I've implemented this with powershell and the cli53 windows exe on my windows servers. Nov 12 '15 at 13:53

You can use Elastic IP to have "static" IP assigned to your EC2 or use CloudFormation template to update your Route53 records when creating new EC2 instance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.