Skip to content

Instantly share code, notes, and snippets.

@dgulinobw
Created June 15, 2016 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgulinobw/63c6a64e437dfcc6e2394b38a3f310a3 to your computer and use it in GitHub Desktop.
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
#!/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