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 個回答
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
專家
Matt-B
已回答 2 年前
profile pictureAWS
專家
Chris_G
已審閱 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南