`InvalidChangeBatch: RRSet of type CNAME with DNS name example.com. is not permitted at apex in zone example.com.`
BeginnerTroubleshootingRoute 53, CloudFront, API Gateway and Messaging
Answer
Likely causes → DNS does not allow a CNAME at the zone apex, because it would clash with the SOA and NS records there.
Diagnose →
aws route53 list-resource-record-sets --hosted-zone-id Z0123ABC --query "ResourceRecordSets[?Name=='example.com.']"
Fix → Use a Route 53 alias A/AAAA record to the ALB, CloudFront or S3 target:
aws route53 change-resource-record-sets --hosted-zone-id Z0123ABC --change-batch '{
"Changes":[{"Action":"UPSERT","ResourceRecordSet":{"Name":"example.com","Type":"A",
"AliasTarget":{"HostedZoneId":"Z35SXDOTRQ7X7K","DNSName":"dualstack.web-123.us-east-1.elb.amazonaws.com","EvaluateTargetHealth":true}}}]}'
The alias HostedZoneId is the load balancer's canonical zone ID, not your zone's ID.
Prevent → Use alias records for AWS targets everywhere. They are free to query and follow IP changes automatically.
More on Route 53, CloudFront, API Gateway and Messaging
You created a public hosted zone and records for `example.com`, but `dig example.com` returns `NXDOMAIN` or old records.BeginnerThe primary Region is down, but Route 53 failover records still send traffic to it.IntermediateA Route 53 health check reports `Failure: Connection timed out` for an endpoint that works fine from your laptop.IntermediateYou changed an A record an hour ago, but some users still reach the old server, and a newly created name returned `NXDOMAIN` for a while.AdvancedCloudFront returns `403 AccessDenied` (S3 XML) for every object after you switched the S3 origin to Origin Access Control.IntermediateCloudFront shows `502 ERROR. The request could not be satisfied. CloudFront wasn't able to connect to the origin.`Intermediate