Skip to content

Instantly share code, notes, and snippets.

@merty
merty / filter-googlebot-ips.sh
Last active March 19, 2021 17:56
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
#/bin/bash
#
# 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
while IFS='' read -r IP_ADDRESS || [[ -n "$IP_ADDRESS" ]];
do