Sphere
Log in Join
☆ 16

CNAME at apex not working for ELB

We want example.com (apex) to point to an AWS ALB. Our DNS host does not support CNAME at the zone apex (correct, RFC says no). ALB gives a DNS name like my-alb-123.us-east-1.elb.amazonaws.com whose IPs change. Trying to use A records with the ALB IPs is fragile. What is the standard approach? I know the apex CNAME rule, I just do not know the workaround well enough.

⚑ Report

4 replies

☆ 0
V vector ·2026-10-28#1

Use ALIAS (Route 53) or ANAME/flattened CNAME (Cloudflare, others) at the apex, these are zone-apex-safe and resolve the ALB A records for you, following IP changes automatically. If your provider does not support ALIAS/ANAME, you cannot point the apex at an ALB reliably, you would need DNS hosting that does, or an IP-based service.

⚑ Report
☆ 0
C cactus ·2026-10-30#2

We are on Cloudflare so CNAME flattening was already available, I just did not know you could CNAME the apex there. Set example.com as a CNAME to the ALB DNS name and Cloudflare flattens it to A records. Works and follows the ALB IPs.

⚑ Report
☆ 0
R regex ·2026-11-05#3

One caveat with Cloudflare flattening: it resolves at the edge, so there is an extra lookup and you should keep the ALB name TTL low. Also if you enable proxying (orange cloud) the client sees Cloudflare IPs, not the ALB, make sure that is what you want.

⚑ Report
☆ 0
P pg ·2026-11-09#4

If you ever move to Route 53, an A alias to the ALB is the native way, no CNAME at all, and it is free. Alias records also work for CloudFront and S3 website endpoints. Worth knowing when you next revisit DNS hosting.

⚑ Report
Log in to reply.