Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws route53 - get DNS A record of a private IP

Basically it's a --filter\ --query question because the docs are kind of messy, what I'm trying to get is the A record in route53 of a specific ip address.

Of course I have this:

aws route53 list-resource-record-sets --hosted-zone-id XXXX123XX

Which outputs a json with all of my existing records on the specified zone, but to filter a specific IP from it and get not the IP but the actual DNS record, I couldn't figure out how to get besides cutting it with bash tools.

Desired output:

my-record.my-domain.com

Can you guys help me out? Thanks.

like image 715
Moshe Avatar asked Oct 20 '25 01:10

Moshe


1 Answers

Example:

aws route53 list-resource-record-sets --hosted-zone-id Z3MANQ630XXXXX --query "ResourceRecordSets[?ResourceRecords[?Value == '10.100.125.42']]"

Filtering output:

aws route53 list-resource-record-sets --hosted-zone-id Z3MANQ630XXXXX --query "ResourceRecordSets[?ResourceRecords[?Value == '10.100.125.42']]" |jq -r .[].Name
like image 137
Dennis Avatar answered Oct 21 '25 17:10

Dennis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!