Created
December 15, 2023 19:37
-
-
Save hablutzel1/4eb7f393aab8196362fa7270396126c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IP_ADDRESS="$1" | |
HOSTED_ZONES=$(aws route53 list-hosted-zones) | |
echo "$HOSTED_ZONES" | jq -r '.HostedZones[].Id' | while read ZONE_ID; do | |
RECORD_SETS=$(aws route53 list-resource-record-sets --hosted-zone-id "$ZONE_ID" --query "ResourceRecordSets[?ResourceRecords[?Value == '$IP_ADDRESS']].Name") | |
for RECORD_SET in $RECORD_SETS; do | |
echo $RECORD_SET | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment