Opscraft
DNS record types · Lesson 2 of 7 · 4 min read

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:

Enlarge diagramblog.example.comCNAMEacme.ghost.ioCNAME target198.51.100.7its A recordNo CNAME at the apex (example.com): the apex must also hold SOA and NS records, and a CNAME cannot sitbeside anything else.is an alias ofresolves to
Figure 1. A CNAME says "this name is really that name". The resolver follows it to the final address, which is why a CNAME cannot share its name with any other record.
Swipe sideways to see all of it, or tap to open it full screen.
  1. 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".
  2. Therefore no CNAME at the zone apex, because the apex must hold SOA and NS records.
  3. 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_health lets 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.

Enlarge diagramResolverRoute 53alias A recordALBIPs change as it scalesexample.com A?what are your IPs right now?A 3.6.10.20, 13.2.4.5works at the apexfollows IP changesfree queries for AWS targetscan check target health
Figure 2. Pointing the bare domain at a load balancer. A Route 53 alias looks like a normal A record to the world, but Route 53 fills in the target's current IPs itself.
Swipe sideways to see all of it, or tap to open it full screen.