Skip to content

Route 53

CloudMock emulates Amazon Route 53, supporting hosted zone management and DNS record set operations. Records are stored for reference but DNS resolution is not performed.

OperationStatusNotes
CreateHostedZoneSupportedCreates a public or private hosted zone
ListHostedZonesSupportedReturns all hosted zones
GetHostedZoneSupportedReturns details for a specific zone
DeleteHostedZoneSupportedDeletes a hosted zone
ChangeResourceRecordSetsSupportedCreates, updates, or deletes DNS records
ListResourceRecordSetsSupportedReturns all DNS records in a zone
Terminal window
# Create a hosted zone
curl -X POST http://localhost:4566/2013-04-01/hostedzone \
-H "Content-Type: application/xml" \
-d '<CreateHostedZoneRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
<Name>example.com</Name>
<CallerReference>unique-ref-1</CallerReference>
</CreateHostedZoneRequest>'
# List hosted zones
curl http://localhost:4566/2013-04-01/hostedzone
import { Route53Client, CreateHostedZoneCommand, ChangeResourceRecordSetsCommand } from '@aws-sdk/client-route-53';
const r53 = new Route53Client({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const zone = await r53.send(new CreateHostedZoneCommand({
Name: 'example.com', CallerReference: 'ref-1',
}));
await r53.send(new ChangeResourceRecordSetsCommand({
HostedZoneId: zone.HostedZone!.Id!,
ChangeBatch: {
Changes: [{
Action: 'UPSERT',
ResourceRecordSet: {
Name: 'api.example.com', Type: 'A', TTL: 300,
ResourceRecords: [{ Value: '10.0.0.1' }],
},
}],
},
}));
import boto3
r53 = boto3.client('route53', endpoint_url='http://localhost:4566',
aws_access_key_id='test', aws_secret_access_key='test',
region_name='us-east-1')
zone = r53.create_hosted_zone(Name='example.com', CallerReference='ref-1')
zone_id = zone['HostedZone']['Id']
r53.change_resource_record_sets(
HostedZoneId=zone_id,
ChangeBatch={
'Changes': [{
'Action': 'UPSERT',
'ResourceRecordSet': {
'Name': 'api.example.com', 'Type': 'A', 'TTL': 300,
'ResourceRecords': [{'Value': '10.0.0.1'}],
},
}],
},
)
records = r53.list_resource_record_sets(HostedZoneId=zone_id)
for rrs in records['ResourceRecordSets']:
print(rrs['Name'], rrs['Type'])
cloudmock.yml
services:
route53:
enabled: true

No additional service-specific configuration is required.

  • DNS resolution is not performed — records are stored for reference only.
  • ChangeResourceRecordSets supports CREATE, DELETE, and UPSERT actions.
  • Alias records are accepted and stored but not resolved.
  • Traffic policies, health checks, and DNSSEC are not implemented.
  • Hosted zone delegation is not implemented.
CodeHTTP StatusDescription
NoSuchHostedZone404The specified hosted zone does not exist
HostedZoneAlreadyExists409A hosted zone with this name already exists
InvalidChangeBatch400The change batch is not valid
InvalidInput400An input parameter is not valid