Get all A Records from route 53 using CLI and export to CSV

0

I've been trying to get all the listed A records on our system due to us having a mismatch between our instances and the number of A records we have. I have asked in numerous places and look online and it seems to be quite difficult to do. I either get only a partial listing or a listing with out extraneous information.

What would be an aws cli command to get only a records

1 Answer
2

There isnt a way to do this natively

You can try this cli command (from here)

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/Z#################" | jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?] | @csv'

You may have issues if there are more than 1000 record sets as you will hit the pagination limit.

You can also try a third party too like cli53 that can export the zone to BIND format

profile pictureAWS
EXPERT
Matt-B
answered 2 years ago
profile pictureAWS
EXPERT
Chris_G
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions