Skip to Content

Records and hosted zones

What a Route 53 record contains, the record types to know, public and private hosted zones, and how TTL trades freshness against cost.

Records

A record says how to route traffic for a name. Each record has:

  • Name: the domain or subdomain, such as example.com or api.example.com.
  • Type: such as A or AAAA.
  • Value: what the name points to, such as 12.34.56.78.
  • Routing policy: how Route 53 chooses an answer (see routing policies).
  • TTL: how long resolvers may cache the answer.

Record types

Know these four well:

  • A: maps a name to an IPv4 address.
  • AAAA: maps a name to an IPv6 address.
  • CNAME: maps a name to another name, whose own A or AAAA record gives the address. A CNAME can't be created at the top of a domain (the zone apex): it works for www.example.com, not for example.com. See CNAME vs alias.
  • NS: the name servers for the hosted zone: the servers that answer for the domain and so control how its traffic is routed.

Route 53 also supports CAA, DS, HTTPS, MX (mail servers), NAPTR, PTR, SOA, SPF, SRV, SSHFP, SVCB, TLSA and TXT (often used to prove domain ownership).

Hosted zones

A hosted zone is a container for the records of a domain and its subdomains.

A public hosted zone answers anyone on the internet, for example shop.example.com resolves to a public load balancer; a private hosted zone answers only inside the VPCs associated with it, for example db.company.internal resolves to the private IP address of an RDS database A public hosted zone answers anyone on the internet, for example shop.example.com resolves to a public load balancer; a private hosted zone answers only inside the VPCs associated with it, for example db.company.internal resolves to the private IP address of an RDS database

Public names for the internet, private names for VPCs.
  • Public hosted zones hold records for routing traffic on the internet, for public names like application1.mypublicdomain.com. Anyone can query them. Answers can point to S3 websites, CloudFront, public EC2 instances or load balancers.
  • Private hosted zones hold records for routing traffic inside one or more VPCs associated with the zone, for private names like db.company.internal. Only resources in those VPCs get answers. They usually point to private IP addresses: internal web servers, databases, internal load balancers.

For private hosted zones, the VPC must have the DNS hostnames and DNS resolution settings turned on.

Pricing: $0.50 per hosted zone per month (for the first 25), plus a small charge per million queries for public zones. Queries to private zones are free, and a zone deleted within 12 hours of creation isn't charged.

TTL (time to live)

Example

A client asks Route 53 for myapp.example.com and gets A 12.34.56.78 with a TTL of 300 seconds. For the next five minutes it uses the cached address without asking again. Only after the TTL runs out does it ask Route 53 for a fresh answer.

  • High TTL (for example 24 hours): less traffic to Route 53 and lower cost, but clients may keep using outdated records for a long time after a change.
  • Low TTL (for example 60 seconds): more queries (more cost), but changes reach clients quickly, so records change quickly.
  • A common trick: lower the TTL a day before a planned change, make the change, then raise it again.
  • A TTL is required on every record, except alias records, which use the TTL of the AWS resource they point to.

Exam tips

  • "Map a name to IPv4" → A. "IPv6" → AAAA. "Name to another name" → CNAME. "Who answers for this domain" → NS.
  • "Internal DNS names for resources in a VPC" → private hosted zone (with DNS hostnames and resolution on).
  • "Clients still go to the old IP address after a change" → the TTL is too high; lower it before changes.
  • "Reduce Route 53 query costs" → raise the TTL (or use alias records to AWS resources, which are free).

Common traps

  • "Create a CNAME for example.com." Not allowed at the zone apex; use an alias.
  • "A private hosted zone works on the internet." Only inside associated VPCs.
  • "Lower TTL means lower cost." It means more queries and higher cost.

Hands-on lab: a private hosted zone

Goal: create a private hosted zone with one record and resolve it from an EC2 instance, with no domain to buy.

Costs money

A hosted zone deleted within 12 hours is free; you only pay for the EC2 instance you test from (about $0.01). Any Region works.

Before you start: you need saa-web (or any instance) in the default VPC, from the EC2 basics lab.

Create the zone

Route 53 → Hosted zones → Create hosted zone. Domain name saa.internal, type Private hosted zone, associate the default VPC in your Region. Create. Route 53 adds the NS and SOA records itself.

Add a record

Create record: name web, type A, value the private IP of saa-web, TTL 60. Create.

Resolve it

Connect to saa-web with EC2 Instance Connect and run:

dig web.saa.internal

The answer section shows web.saa.internal. 60 IN A <private IP>. From CloudShell (outside the VPC) the same name doesn't resolve.

Expected result: an internal DNS name that only works inside your VPC.

Clean up: delete the web record, then the hosted zone (within 12 hours to avoid the monthly charge).

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt