Three ways to keep an EC2 reachable, and why DDNS stopped saving money

awsec2networkingroute53

You launch an EC2 and AWS hands it a public IP. You point a DNS record at it and get to work. Then you stop the box overnight to save money, start it in the morning, and the IP is different. Every link to the old one breaks.

The auto IP is dynamic. To stay reachable you need an address that doesn't move. Three ways.

1. Auto-assigned public IP

Free to ask for, but it changes on every stop/start. Fine for a throwaway box, useless for anything you need to find again.

2. Elastic IP

A fixed address tied to your account. Attach it once, point an A record at it, done. It survives restarts.

It used to be free while attached. Not anymore: since February 1, 2024, [every public IPv4 address costs 0.005/hour](https://aws.amazon.com/blogs/aws/newawspublicipv4addresschargepublicipinsights/)(about0.005/hour](https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/) (about 3.6/month), in use or not. So an Elastic IP is a small, fixed line item. Release ones you're not using, or you're paying for nothing.

3. DDNS

Keep the dynamic IP, put a name in front. A small client on the instance loops over two steps:

  1. ask the outside "what's my public IP right now?" (the box can't see it itself, AWS NATs it),
  2. if it changed, tell a DNS provider to re-point the name at the new IP.

So myserver.ddns.net always finds the box even as the IP flips from 54.201.13.7 to 3.88.42.190. You connect to the name; the client chases the IP.

Already own a domain? You usually can't have the client update it directly: registrars like Squarespace are static, set by hand. So get a free DDNS hostname and bridge to it with one CNAME, set once and never touched again:

your.domain.com  ──CNAME──►  myserver.ddns.net  ──(DDNS keeps current)──►  the live IP

The catch. DDNS used to be the cheap option, because the auto IP it rides on was free. After the 2024 change that IP costs the same $3.6/month as an Elastic IP. So DDNS no longer saves money. It just swaps a fixed IP for a free name plus a client to babysit. These days an Elastic IP is simpler for the same price.

Where Route 53 fits

An A record maps a name to a fixed IP (app.mysite.com → 54.201.13.7). A Route 53 alias maps a name to an AWS resource (ELB, CloudFront) and tracks its shifting IPs for you (alias targets are AWS resources, not a raw EC2).

So with an Elastic IP, use a plain A record; it never moves. A bare EC2 has no alias target, so it only gets an A record to its IP, which is exactly why it wants a fixed one. And if an ELB or CloudFront sits in front, alias your domain to that and drop the Elastic IP entirely; AWS tracks the IPs.

The takeaway

A public IP isn't free just because it's attached; since 2024 every one is metered. So choose by simplicity, not cost: a fixed Elastic IP for anything real, an ELB or CloudFront in front if you'd rather forget IPs entirely, and DDNS only for hobby boxes where a free name is worth babysitting a client.

References