GateCheck

How to Tell Real Googlebot from a Fake

A request can send a User-Agent string that says Googlebot without coming from Google. If you make access decisions from crawler identity, verify the source address using Google’s published guidance rather than trusting the header by itself.

Published

Why a User-Agent is not proof

The User-Agent header is text supplied with a request. Ordinary browser tools can change it, and an automated client can write any crawler name it wants. A request that claims to be Googlebot should therefore not receive special access solely because its header contains that word.

This matters when a site allows search crawlers through a protection rule. If a fake crawler can copy the same header and be treated as trusted, the rule does not verify the visitor. Keep crawler identity separate from user-agent detection and use an IP-based verification method when the source needs to be trusted.

Use Google’s documented verification methods

Google describes two ways to verify crawler requests: check the source IP against Google’s published crawler IP ranges, or use reverse DNS followed by a forward DNS check. For a one-off investigation, the DNS method can be enough. For software that processes many requests, matching against the published ranges is usually easier to automate and keep current.

Google distinguishes common crawlers such as Googlebot from special-case crawlers and user-triggered fetchers. Use the IP list that matches the kind of request you are checking. A request from a different Google product is not automatically Googlebot for Search, and different crawler categories may follow different rules.

  • Record the source IP from the request as seen by your trusted server or proxy.
  • For a one-off check, look up the IP’s reverse DNS name.
  • Confirm the returned hostname belongs to the appropriate Google domain.
  • Resolve that hostname forward and confirm the original IP is returned.
  • For automation, compare the IP with Google’s current published crawler ranges.

Perform a reverse and forward DNS check

For a manual check, run a reverse lookup on the source IP from your logs. A real Googlebot address can resolve to a hostname under googlebot.com; Google’s documentation also describes other Google-owned domains for other crawler or fetcher categories. Do not accept an unrelated hostname just because it contains the word Google.

Then look up the returned hostname and confirm that it resolves back to the same IP address that made the request. This second lookup matters: a hostname that looks plausible is not enough if it does not point back to the source address. Use DNS tools such as host or dig, and apply the exact domain and range guidance from Google’s current documentation.

host SOURCE_IP
host RETURNED_HOSTNAME

Use published IP ranges for repeated checks

If your server evaluates many crawler requests, download or otherwise consume the relevant official IP range data and compare the request’s source address with those ranges. The data changes over time, so refresh it according to Google’s published process rather than copying a list into a rule and forgetting it.

Make sure the address you check is the visitor address from a trusted source. If your application is behind a proxy or CDN, do not trust an arbitrary forwarded-IP header from the public request. Configure the trusted proxy chain and use the address your server has safely established.

Avoid broad allow rules

Do not let every request from a cloud provider or from a large address range through because one crawler you use comes from there. Keep the allow rule narrow to the verified crawler category and the purpose for which it is needed. A broad allow can grant access to unrelated services that share infrastructure.

If you find a request pretending to be Googlebot, preserve the relevant logs and decide how to handle it under your normal security rules. A fake User-Agent is not proof of malicious activity by itself, but it is also not a reason to grant crawler privileges. Apply the same careful verification to any crawler you choose to trust.

How GateCheck handles search crawlers

GateCheck lets verified search crawlers, including Googlebot and Bingbot, through by default, along with Google’s ad crawlers (AdSense and Ads). It checks each one against the address ranges the company publishes, or with a reverse and forward DNS lookup, rather than trusting the User-Agent. A request that only claims to be Googlebot is treated as an unverified bot. For other bots you rely on, such as an uptime monitor or link previews, add their names under Bots you let in; an impostor of a known crawler is still stopped.

Files that crawlers need, such as robots.txt, ads.txt and sitemap.xml, are open to everyone by default. Keep the allow-good-bots setting on if you want verified search crawlers to reach public pages, and check your rules before changing it. Search crawlers still need access to the page and its assets to understand the content. Review the GateCheck docs for how crawler decisions fit with the rest of the visit rules.

Use Google’s source documentation

Google’s instructions and crawler range files are the source of truth for current verification details. Read Verify requests from Google crawlers and fetchers before building an automated allow rule. The page explains reverse and forward DNS checks and links to the current address ranges.

Test changes with real requests and monitor whether public pages remain accessible to verified crawlers. Do not use a spoofed User-Agent as the only test: that only proves your site reacts to a string, not that it verifies Google’s source address.

Related guides