Subchapter 91.5
references/creating-a-public-dns-record.mdMarkdown13 KBView on GitHub
Domain expertise for adding or updating a record in a Route 53 public hosted zone so a hostname resolves to a target: an IP address, an AWS resource, or another hostname. Covers the choice between alias and standard records, the zone apex (root domain) constraint, long TXT value handling, and the Evaluate Target Health (ETH) toggle on alias records.
Does not cover routing policies that split or steer traffic (weighted, failover, latency, geolocation), private hosted zones for hybrid networks, domain registration, or health check creation. Those are separate skills.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging, observability). Fall back to the AWS CLI otherwise.
To create or update a public DNS record, follow the procedure exactly. See the Procedure section below.
The procedure covers:
| Choice | Use when |
|---|---|
| Alias (A or AAAA) | The target is a supported AWS resource, or the record is at the zone apex. Free to query, tracks the target’s IP changes, inherits the target’s TTL |
| Standard (A, AAAA, CNAME) | The target is a non-AWS hostname or IP, or the customer needs explicit TTL control. CNAME only on a subdomain, never at the apex |
Constraints:
A CNAME cannot exist at the zone apex (example.com). RFC 1034 prohibits a CNAME alongside the
Start of Authority (SOA) and name server (NS) records that always exist at the apex, so Route 53
rejects the create.
Constraints:
A single TXT string is capped at 255 characters by the DNS protocol. A longer value (commonly a DomainKeys Identified Mail, DKIM, public key) must be split into multiple quoted strings in the same record; Route 53 concatenates them when answering.
Constraints:
ETH only changes behavior when the record participates in a health-aware routing setup (failover, weighted, latency). For a standalone record pointing at a single target it has no practical effect.
Constraints:
A CNAME was attempted at the zone apex (prohibited by RFC 1034). Use an alias record at the apex.
A standard record points at an AWS hostname whose IPs rotated. Replace it with an alias record, which tracks the target’s IPs.
A single TXT string exceeded 255 characters. Split the value into multiple quoted 255-character strings in one record.
Alias records inherit the target’s TTL. Remove the manual TTL.
The record type does not match the target address family. Use type A for IPv4, type AAAA for IPv6.
This procedure adds or updates a record in a Route 53 public hosted zone so a hostname resolves to a target: an IP, an AWS resource, or another hostname. It chooses alias vs standard records, handles the zone apex constraint and long TXT values, and surfaces the console link to verify.
Z1234567890ABC).www.example.com or the apex example.com).A, AAAA, CNAME, TXT, etc.true when the target is a supported
AWS resource (at any level, including the apex), or when the record is at the zone apex AND a
CNAME was requested (a CNAME is prohibited at the apex, so an alias is the substitute). A plain
A or AAAA record at the apex pointing to a non-AWS IP address is NOT an alias — leave is_alias
false in that case.Provide exactly one of the following groups, based on is_alias:
Alias record (is_alias = true) — provide an alias target:
my-alb-123456789.us-east-1.elb.amazonaws.com).hosted_zone_id. Resolve it by target type:
Z2FDTNDATAQYW2CanonicalHostedZoneId (aws elbv2 describe-load-balancers)CanonicalHostedZoneNameID (aws elb describe-load-balancers)hosted_zone_idfalse): The ETH toggle. Leave false for a
plain single-target record (see the ETH decision section).Standard record (is_alias = false) — provide records and a TTL:
Constraints for parameter acquisition:
Constraints:
You MUST confirm credentials with aws sts get-caller-identity
You MUST REQUIRE provisioning credentials through ephemeral mechanisms (IAM roles via instance profiles, SSO/IAM Identity Center session credentials, or aws sts assume-role) rather than long-lived IAM user access keys.
You MUST enable Route 53 query logging to an encrypted destination where applicable, ensure CloudTrail is enabled to audit changes, and set CloudWatch alarms on health-check status where health checks are involved.
You MUST confirm the hosted zone exists and is public:
aws route53 get-hosted-zone --id {hosted_zone_id} --region us-east-1Constraints:
Constraints:
Constraints:
record_type is TXT and the value exceeds 255 characters, you MUST split it into multiple
quoted 255-character strings within the same recordConstraints:
You MUST use UPSERT to create or update the record. For an alias record:
aws route53 change-resource-record-sets --hosted-zone-id {hosted_zone_id} --change-batch '{
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "{record_name}",
"Type": "{record_type}",
"AliasTarget": {
"DNSName": "{alias_target_dns_name}",
"EvaluateTargetHealth": {evaluate_target_health},
"HostedZoneId": "{alias_target_zone_id}"
}
}
}]
}'For a standard record, replace AliasTarget with TTL ({ttl}) and ResourceRecords (from
records)
You MUST capture the change ID from the response
Constraints:
You MUST verify the change reaches INSYNC. The status starts as PENDING and propagation
can take up to ~60 seconds, so poll rather than expecting INSYNC on the first call:
aws route53 get-change --id {change_id}You SHOULD treat PENDING as in-progress, not a failure; only surface an error if the status
has not reached INSYNC after a reasonable polling window
You MUST present the records view console link, filling {hostedZoneId}:
https://console.aws.amazon.com/route53/v2/hostedzones#ListRecordSets/{hostedZoneId}{
"hosted_zone_id": "Z1234567890ABC",
"record_name": "example.com",
"record_type": "A",
"is_alias": true,
"alias_target_dns_name": "my-alb-123456789.us-east-1.elb.amazonaws.com",
"alias_target_zone_id": "Z35SXDOTRQ7X7K"
}Created alias A record example.com -> my-alb-123456789.us-east-1.elb.amazonaws.com
Verify in the console:
https://console.aws.amazon.com/route53/v2/hostedzones#ListRecordSets/Z1234567890ABCCNAME attempted at the zone apex. Use an alias record (Step 3).
Standard record pointed at an AWS hostname whose IPs rotated. Replace with an alias record (Step 2).
A single TXT string exceeded 255 characters. Split into quoted 255-character strings (Step 4).
Alias records inherit the target’s TTL. Remove the TTL.
aws sts assume-role) rather than
long-lived IAM user access keys, and prefer read-only credentials for inspection steps. Grant
only the specific actions this procedure needs — route53:ChangeResourceRecordSets and
route53:GetChange to create the record and confirm propagation, plus
route53:ListResourceRecordSets and route53:GetHostedZone for inspection — rather than
route53:* or broader service:* wildcards.