Address and alias records: A, AAAA, CNAME, ALIAS
A and AAAA
- A — name → IPv4 address:
api.example.com. 300 IN A 203.0.113.10. - AAAA ("quad-A") — name → IPv6 address:
api.example.com. 300 IN AAAA 2001:db8::10. - One name can have several A records (all returned) — simple distribution, with no health checking (unless you use Route 53 multivalue answers with health checks).
- Dual-stack clients query both A and AAAA and prefer IPv6 when it works ("Happy Eyeballs").
CNAME
A CNAME (canonical name) makes one name an alias of another name:
blog.example.com. 3600 IN CNAME acme.ghost.io.
www.example.com. 300 IN CNAME example.com.
The resolver follows the chain: blog.example.com → acme.ghost.io → its A records. Use it to point at third-party hosts whose IPs you don't control (SaaS, CDNs, ELB DNS names) — when they change IPs, you don't have to.
The CNAME rules:
- A name with a CNAME can't have any other record (no MX, TXT or A alongside it) — the CNAME means "everything about this name lives over there".
- Therefore no CNAME at the zone apex, because the apex must hold SOA and NS records.
- MX and NS records must point to names with A/AAAA records, not to CNAMEs.
Long CNAME chains (four hops through different providers) add lookups, latency and failure points — flatten where possible.
Route 53 alias records
AWS's answer to "I want example.com (the apex) to point to my ALB":
resource "aws_route53_record" "apex" {
zone_id = var.zone_id
name = "example.com"
type = "A"
alias {
name = aws_lb.web.dns_name
zone_id = aws_lb.web.zone_id
evaluate_target_health = true
}
}
An alias record is a Route 53 extension: you create an A (or AAAA) record whose value Route 53 resolves internally from the target — returning the target's current IPs directly. Properties:
- Works at the apex (it's a real A record to the outside world).
- Targets: ALB/NLB/CLB, CloudFront, S3 static website endpoints, API Gateway, VPC interface endpoints, Global Accelerator, Elastic Beanstalk, App Runner, and other records in the same hosted zone.
- Follows target IP changes automatically — essential because ELB IPs change as they scale.
- Free queries for AWS targets (CNAME queries are billed).
- TTL comes from the target (60 s for ELB).
evaluate_target_healthlets routing policies skip unhealthy targets.
Never put an ALB's current IPs in a plain A record — they will change.
Other providers offer the same idea as ALIAS/ANAME records or CNAME flattening (Cloudflare): the provider resolves the CNAME target itself and returns A records at the apex.
Typical setup: apex example.com → alias A (and AAAA) to the ALB or CloudFront; www.example.com → CNAME to example.com or its own alias; app subdomains → aliases or External DNS-managed records.