- Install AWS CLI on a linux machine.
- Get the hosted zone ID for the hosted zone by logging onto AWS console and navigating to Route 53 panel.
- Ensure that AWS CLI user has permissions to read Route 53 records. You can attach AmazonRoute53ReadOnlyAccess policy to the user.
- Run the following command to get the output in json format.
$ aws route53 list-resource-record-sets --hosted-zone-id J2L9LK3GC3000 > ~/domainzone.txt