Created
June 15, 2016 19:54
-
-
Save dgulinobw/63c6a64e437dfcc6e2394b38a3f310a3 to your computer and use it in GitHub Desktop.
Search all your AWS r53 DNS zones for records that point to specified IP address
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=${1} | |
zones=$(aws route53 list-hosted-zones | jq '.HostedZones[] | .Id' | awk -F"/" '{print $3}' | tr -d '"') | |
for zone in ${zones} | |
do | |
aws route53 list-resource-record-sets --hosted-zone-id=${zone} | jq '.ResourceRecordSets[] | select(.ResourceRecords[0].Value == "'${ip}'")' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment