Last active
December 20, 2020 09:40
-
-
Save alikalantaripor/384bef807f48dde13e981dc2ec78a1f9 to your computer and use it in GitHub Desktop.
Performs reverse and forward DNS lookups to list Googlebot's IPs, given a list of IP addresses as a file. Useful for filtering access logs to find out actual Googlebot visits. An implementation of https://support.google.com/webmasters/answer/80553?hl=en
This file contains hidden or 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 | |
# example: ./find-google-ips.sh list.txt > google.txt | |
while IFS= read -r ip | |
do | |
FIND_HOST="$(host $ip)" | |
if [[ $FIND_HOST == *"google"* ]]; then | |
echo $ip | |
fi | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment