Pro Route 53

The Route53 API in LocalStack Pro allows you to create hosted zones and to manage DNS entries (e.g., A records) which can then be queried via the built-in DNS server.

The example below illustrates the creation of a hosted zone, registration of an A record named that points to, and finally querying the DNS record by using the dig command against the DNS server running on localhost (inside the LocalStack container, on port 53):

$ zone_id=$(awslocal route53 create-hosted-zone --name --caller-reference r1 | jq -r '.HostedZone.Id')
$ awslocal route53 change-resource-record-sets --hosted-zone-id $zone_id --change-batch 'Changes=[{Action=CREATE,ResourceRecordSet={,Type=A,ResourceRecords=[{Value=}]}}]'
$ dig @localhost

Note: Using the built-in DNS capabilities requires privileged access for the LocalStack container (please also refer to the DNS_ADDRESS configuration variable).