How to Point Domain to ALB in AWS: Simple Steps
To point your domain to an AWS Application Load Balancer (ALB), create an
Alias record in Amazon Route 53 that targets the ALB's DNS name. This connects your domain directly to the ALB without needing an IP address.Syntax
Use an Alias record in Route 53 to point your domain to the ALB. The key parts are:
- Record Name: Your domain or subdomain (e.g.,
example.comorwww.example.com). - Record Type: Use
Afor IPv4 orAAAAfor IPv6. - Alias: Set to
Yesto enable aliasing. - Alias Target: The DNS name of your ALB (e.g.,
my-alb-123456.us-east-1.elb.amazonaws.com).
text
Record Name: example.com Record Type: A Alias: Yes Alias Target: my-alb-123456.us-east-1.elb.amazonaws.com.
Example
This example shows how to create an alias record in Route 53 to point www.example.com to an ALB.
bash
aws route53 change-resource-record-sets --hosted-zone-id Z3P5QSUBK4POTI --change-batch '{
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "www.example.com.",
"Type": "A",
"AliasTarget": {
"HostedZoneId": "Z35SXDOTRQ7X7K",
"DNSName": "my-alb-123456.us-east-1.elb.amazonaws.com.",
"EvaluateTargetHealth": false
}
}
}]
}'Output
{
"ChangeInfo": {
"Id": "/change/C2682N5HXP0BZ4",
"Status": "PENDING",
"SubmittedAt": "2024-06-01T12:00:00Z",
"Comment": "Upsert alias record to ALB"
}
}
Common Pitfalls
- Not using an
Aliasrecord and instead using a CNAME at the root domain, which is not allowed. - Using the wrong ALB DNS name or region-specific hosted zone ID.
- Forgetting the trailing dot
.at the end of domain names in Route 53 records. - Not waiting for DNS propagation after changes.
text
Wrong way: Record Name: example.com Record Type: CNAME Value: my-alb-123456.us-east-1.elb.amazonaws.com Right way: Record Name: example.com Record Type: A Alias: Yes Alias Target: my-alb-123456.us-east-1.elb.amazonaws.com.
Quick Reference
| Step | Action | Notes |
|---|---|---|
| 1 | Find ALB DNS Name | From AWS Console under Load Balancers |
| 2 | Get ALB Hosted Zone ID | Use AWS docs or CLI for region-specific ID |
| 3 | Open Route 53 | Select your hosted zone for your domain |
| 4 | Create Alias Record | Set record type A, alias Yes, target ALB DNS |
| 5 | Save and Wait | DNS changes can take minutes to propagate |
Key Takeaways
Use an Alias A record in Route 53 to point your domain to the ALB DNS name.
Do not use CNAME records for root domains; Alias records are required.
Ensure you use the correct ALB DNS name and hosted zone ID for your region.
Remember to include trailing dots in domain names when configuring Route 53 records.
Allow time for DNS propagation after updating your records.