Skip to content
All articles

How do you verify that a crawler is really Googlebot?

guide // , 4 min read, by Darthwares

You verify that a crawler is really Googlebot by running a reverse and forward DNS lookup on the accessing IP address or matching it against Google's published IP ranges. Because HTTP user-agent request headers are easily spoofed by unauthorized crawlers, relying on header strings alone is not secure. Google Search Central documents these verification methods so website operators can accurately identify legitimate crawling activity in their server logs.

Illustration with sample values.
On this page // 6 sections
  1. 01Why should you verify Googlebot requests?
  2. 02How do you verify Googlebot using DNS lookups?
  3. 03How do you verify Googlebot using published IP ranges?
  4. 04How do Google crawlers handle user agents and robots.txt?
  5. 05How do you diagnose suspicious Googlebot requests?
  6. 06Common questions

The short version

  • HTTP user-agent request headers can easily be spoofed by unauthorized crawlers.
  • A two-step reverse and forward DNS lookup verifies whether an accessing IP address belongs to Google.
  • Matching IP addresses against Google's published CIDR JSON files provides an alternative verification method.
  • Automatic Google crawlers always obey robots.txt rules, whereas user-triggered fetchers generally ignore them.

Why should you verify Googlebot requests?

You should verify Googlebot requests because unauthorized crawlers often spoof the HTTP user-agent header to impersonate Google. A crawler, robot, or spider is a generic term for any program used to automatically discover and scan websites. Google for Developers explains that common crawlers are used to find information for building search indexes, perform product-specific crawls, and conduct analysis. However, spammers or other troublemakers can fake their user-agent strings when requesting pages from your server.

Before deciding to block suspicious traffic, Google Search Central highlights that it is important to verify whether a problematic request actually comes from Google. Relying solely on the user-agent header string is unsafe because any client can send a fake header that matches Google's common user agents.

How do you verify Googlebot using DNS lookups?

You verify Googlebot using DNS lookups by running a reverse DNS lookup on the accessing IP address and confirming it with a forward DNS lookup. Google Search Central states that a reverse DNS check on the source IP is one of the best ways to verify if a request comes from Googlebot. Google notes that common crawlers generally crawl from IP ranges published in the common-crawlers.json object and use hostnames under googlebot.com.

  1. 01Run a reverse DNS lookup on the accessing IP address from your server logs using the host command.
  2. 02Verify that the retrieved domain name is either googlebot.com, google.com, or googleusercontent.com.
  3. 03Run a forward DNS lookup on the domain name retrieved in step 1 using the host command on that domain name.
  4. 04Verify that the resulting IP address matches the original accessing IP address from your server logs.

How do you verify Googlebot using published IP ranges?

You can verify Googlebot by matching the crawler's IP address directly against Google's official published IP range JSON files. To optimize bandwidth usage, Google distributes its crawling clients across many datacenters around the world so they are located near the sites they access. Because of this distribution, your server logs may show visits from several different IP addresses, though Google egresses primarily from IP addresses in the United States.

Google for Developers notes that IP addresses in these official JSON files are represented in CIDR format. You can match common crawlers against common-crawlers.json, while user-triggered fetchers are published in objects such as user-triggered-fetchers.json, user-triggered-fetchers-google.json, and user-triggered-agents.json.

How do Google crawlers handle user agents and robots.txt?

Google's common crawlers always obey robots.txt rules when crawling automatically, whereas user-triggered fetchers generally ignore robots.txt rules. You can identify the specific subtype of Googlebot by inspecting the HTTP user-agent request header in the incoming request. When searching server logs or filtering traffic for a user-agent pattern, Google recommends using wildcards for the version number rather than specifying an exact version string.

Google Search Central notes that both Googlebot Smartphone and Googlebot Desktop obey the same product token in robots.txt, meaning you cannot selectively target either subtype using robots.txt rules. In contrast, user-triggered fetchers are initiated by users to perform a fetching function within a Google product, which is why they generally ignore robots.txt rules.

How do you diagnose suspicious Googlebot requests?

You diagnose suspicious requests by running DNS lookups or matching server log IP addresses against published IP ranges. It is important to verify that a problematic request claiming to be from Google actually comes from Google before deciding to block it. Spammers or troublemakers may access your site claiming to be from Google, so verifying requests helps protect your server.

Diagnostic checks for verifying Googlebot requests
Observed SymptomDiagnostic CheckVerification Fix
Access log shows Googlebot user-agent from unknown IPRun reverse and forward DNS lookup using the host commandVerify domain is googlebot.com, google.com, or googleusercontent.com and matches original IP
High request volume from IP not matching DNS maskCompare crawler IP address against official JSON range filesVerify if IP is listed in CIDR format in published JSON files
Fetcher ignores robots.txt rules while claiming Google originDetermine if request matches user-triggered fetcher IP rangesCheck IP against user-triggered-fetchers.json lists

Common questions

Can an HTTP user-agent header guarantee a request comes from Googlebot?

No, Google cautions that the HTTP user-agent request header can easily be spoofed by other crawlers.

What domain names should appear during a reverse DNS lookup for Googlebot?

Google documents that the domain name must be either googlebot.com, google.com, or googleusercontent.com.

Can you block Googlebot Smartphone in robots.txt while allowing Googlebot Desktop?

No, Google Search Central explains that both Googlebot Smartphone and Googlebot Desktop obey the same product token in robots.txt, so you cannot selectively target either subtype.

Why do server logs show Googlebot visiting from many different IP addresses?

Google distributes its crawling clients across many datacenters worldwide to optimize bandwidth usage near the sites they access, though egress primarily occurs from the United States.

Primary sources and further reading

This article was researched and written by an AI model and published automatically. It was written from sentences that were checked to appear on the pages below, but a person has not reviewed the text. If something is wrong, tell us at chibivikramathithan@darthwares.com and we will correct it.