In short
The user agent is just a text string: any script can present itself as Googlebot or GPTBot. The only reliable proof of identity is the IP address, verified either by a double DNS lookup (reverse, then forward) or by comparison with the lists of ranges that vendors publish. Once this check is done, your firewall exemptions, rate limits and log analyses rely on authenticated crawlers, and fake crawlers are treated as ordinary traffic.
Why it matters
Blind trust in the user agent creates two opposite problems.
- You let impostors in. As soon as a rule says “do not limit Googlebot”, scraping scripts declare themselves as Googlebot. Your exemptions become a back door.
- You count fake visits. Log statistics based on the name inflate the apparent activity of AI crawlers and skew your decisions.
Vendors provide two means of verification:
| Vendor | Reverse then forward DNS | Published address list (JSON) |
|---|---|---|
Yes: googlebot.com, google.com |
Yes, one file per crawler family | |
| Microsoft Bing | Yes: search.msn.com |
Yes |
| OpenAI | Not documented | Yes, one file per crawler |
| Perplexity | Not documented | Yes, one file per crawler |
| Anthropic | Not documented | Yes, one shared file |
The “if possible” in the title has three reasons. Not all crawlers publish their addresses. The lists change without notice, so they must be reloaded automatically. And an overly strict check, based on an outdated list, blocks real crawlers: Anthropic points out that blocking by IP prevents its crawlers from reading your robots.txt, and therefore from following your instructions.
Good to know: a third approach is emerging, cryptographic request signing (Web Bot Auth, based on HTTP message signatures). Cloudflare already accepts it as proof of identity for its verified bots. Adoption by vendors remains partial: follow their documentation.
What it improves
- Security Exemptions granted to crawlers no longer benefit impostors.
- Crawling Real crawlers can safely be exempted from rate limits, country blocks and challenges.
- Measurement reliability Your counts of AI crawler visits only include genuine visits.
- Server costs Traffic posing as a crawler is limited like any other script.
- Rankings and citations No direct effect. This is a hygiene task that makes the other settings safe.
How to check
1. Verify an address by hand. Take an address from your logs that presents itself as Googlebot:
host 66.249.66.1
host crawl-66-249-66-1.googlebot.com
Compliant result: the first command returns a name ending in googlebot.com, the second returns the original address.
1.66.249.66.in-addr.arpa domain name pointer crawl-66-249-66-1.googlebot.com.
crawl-66-249-66-1.googlebot.com has address 66.249.66.1
2. Estimate the share of spoofing. List the addresses that declare themselves as GPTBot, then run them through the script in the next section:
grep "GPTBot" /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head -20
3. Review your rules. Look in the CDN, the firewall and the server for any exemption based only on the user agent. Each one should be replaced with an address check.
How to implement
Verification by reverse then forward DNS
This method works for Google and Bing. It comes down to three checks: the address has a name (reverse DNS), that name belongs to the vendor's domain, and that name does point back to the original address (forward DNS). The third check is essential: anyone can declare any name for their own addresses.
| Crawler | Expected domains |
|---|---|
| Googlebot and Google's common crawlers | googlebot.com (including geo.googlebot.com) |
| Google's special-case crawlers (AdsBot…) | google.com |
| Google's user-triggered fetchers | google.com or gae.googleusercontent.com |
| Bingbot | search.msn.com |
With dig:
dig +short -x 157.55.39.1
dig +short msnbot-157-55-39-1.search.msn.com
Complete script, to save as verifier-dns.sh:
#!/usr/bin/env bash
# Usage: ./verifier-dns.sh 66.249.66.1
set -u
ip="${1:?Usage: $0 IP_ADDRESS}"
name="$(dig +short -x "$ip" | head -n 1)"
name="${name%.}"
if [ -z "$name" ]; then
echo "$ip: no reverse DNS, crawler not verified"
exit 1
fi
case "$name" in
*.googlebot.com|*.google.com) owner="Google" ;;
*.search.msn.com) owner="Bing" ;;
*)
echo "$ip: $name belongs to neither Google nor Bing"
exit 1
;;
esac
if dig +short "$name" A "$name" AAAA | grep -qxF "$ip"; then
echo "$ip: verified $owner crawler ($name)"
exit 0
fi
echo "$ip: $name does not point back to this address, likely spoofing"
exit 1
The script does not accept googleusercontent.com: machines rented on Google Cloud also carry a name in that domain. For an IPv6 address, compare the abbreviated form returned by dig. Never run this check on every request: it costs two DNS lookups. Use it for log analysis, or cache the result per address.
Verification with published address lists
All the files below share the same structure: a prefixes array in which each entry contains ipv4Prefix or ipv6Prefix. Addresses recorded on the date this guide was last updated; they change, so cross-check with the documentation listed under “Resources”.
| Crawler | File |
|---|---|
| Google, common crawlers (Googlebot) | https://developers.google.com/static/crawling/ipranges/common-crawlers.json |
| Google, special-case crawlers | https://developers.google.com/static/crawling/ipranges/special-crawlers.json |
| Google, user-triggered fetchers | user-triggered-fetchers.json, user-triggered-fetchers-google.json and user-triggered-agents.json in the same folder |
| Bingbot | https://www.bing.com/toolbox/bingbot.json |
| OAI-SearchBot | https://openai.com/searchbot.json |
| GPTBot | https://openai.com/gptbot.json |
| ChatGPT-User | https://openai.com/chatgpt-user.json |
| PerplexityBot | https://www.perplexity.ai/perplexitybot.json |
| Perplexity-User | https://www.perplexity.ai/perplexity-user.json |
| Anthropic crawlers | https://claude.com/crawling/bots.json |
Script to check one or more addresses, to save as verifier-ip-robot.py (Python 3 and curl):
#!/usr/bin/env python3
"""Usage: python3 verifier-ip-robot.py 20.171.206.10 [another address...]"""
import ipaddress
import json
import subprocess
import sys
SOURCES = {
"OpenAI OAI-SearchBot": "https://openai.com/searchbot.json",
"OpenAI GPTBot": "https://openai.com/gptbot.json",
"OpenAI ChatGPT-User": "https://openai.com/chatgpt-user.json",
"PerplexityBot": "https://www.perplexity.ai/perplexitybot.json",
"Perplexity-User": "https://www.perplexity.ai/perplexity-user.json",
"Anthropic (Claude crawlers)": "https://claude.com/crawling/bots.json",
"Google (common crawlers, including Googlebot)": "https://developers.google.com/static/crawling/ipranges/common-crawlers.json",
"Bingbot": "https://www.bing.com/toolbox/bingbot.json",
}
def load_networks(url):
output = subprocess.run(
["curl", "-fsS", "--max-time", "20", url],
capture_output=True,
check=True,
).stdout
return [
ipaddress.ip_network(prefix.get("ipv4Prefix") or prefix.get("ipv6Prefix"))
for prefix in json.loads(output)["prefixes"]
]
def main():
if len(sys.argv) < 2:
sys.exit(__doc__)
ranges = {}
for label, url in SOURCES.items():
try:
ranges[label] = load_networks(url)
except Exception as error:
sys.exit(f"List unavailable for {label} ({url}): {error}")
for raw in sys.argv[1:]:
address = ipaddress.ip_address(raw)
owners = [
label
for label, networks in ranges.items()
if any(address in network for network in networks)
]
verdict = ", ".join(owners) if owners else "in no official list"
print(f"{raw}: {verdict}")
if __name__ == "__main__":
main()
Sample output:
20.171.206.10: OpenAI GPTBot
66.249.66.1: Google (common crawlers, including Googlebot)
203.0.113.9: in no official list
Generate the range files for the server
This script downloads the lists and produces one file for Nginx and one for Apache. Remove the lines for crawlers you do not want to exempt. It requires curl and jq. Save it as /usr/local/bin/maj-robots-verifies.sh:
#!/usr/bin/env bash
# Generates the verified crawler range files for Nginx and Apache.
set -euo pipefail
nginx_out="/etc/nginx/robots-verifies.geo"
apache_out="/etc/apache2/robots-verifies-require.conf"
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT
urls="
https://developers.google.com/static/crawling/ipranges/common-crawlers.json
https://www.bing.com/toolbox/bingbot.json
https://openai.com/searchbot.json
https://openai.com/gptbot.json
https://openai.com/chatgpt-user.json
https://www.perplexity.ai/perplexitybot.json
https://www.perplexity.ai/perplexity-user.json
https://claude.com/crawling/bots.json
"
for url in $urls; do
curl -fsS --max-time 20 "$url" \
| jq -r '.prefixes[] | .ipv4Prefix // .ipv6Prefix' >> "$tmp"
done
sort -u "$tmp" -o "$tmp"
if [ "$(wc -l < "$tmp")" -lt 50 ]; then
echo "List abnormally short, files left unchanged." >&2
exit 1
fi
sed 's/$/ 1;/' "$tmp" > "$nginx_out"
sed 's/^/Require ip /' "$tmp" > "$apache_out"
echo "$(wc -l < "$tmp" | tr -d ' ') ranges written."
If a download fails, the script stops without touching the existing files. Schedule it every night in /etc/cron.d/robots-verifies (replace nginx with apache2 and nginx -t with apachectl configtest depending on the server):
17 4 * * * root /usr/local/bin/maj-robots-verifies.sh && nginx -t && systemctl reload nginx
Nginx
Versions Nginx 1.18 and later.
In the http context, the following configuration flags requests that carry a crawler's name without coming from an official address:
geo $robot_verifie {
default 0;
include /etc/nginx/robots-verifies.geo;
}
map $http_user_agent $robot_declare {
default 0;
"~*(Googlebot|bingbot|GPTBot|OAI-SearchBot|ChatGPT-User|PerplexityBot|Perplexity-User|ClaudeBot|Claude-User|Claude-SearchBot)" 1;
}
map "$robot_declare:$robot_verifie" $faux_robot {
default 0;
"1:0" 1;
}
log_format robots '$remote_addr [$time_local] "$request" $status '
'"$http_user_agent" declare=$robot_declare verifie=$robot_verifie';
In the server block:
access_log /var/log/nginx/robots.log robots if=$robot_declare;
if ($faux_robot) {
return 403;
}
Start without the if block: watch /var/log/nginx/robots.log for a few days and check that no real crawler appears with verifie=0 before enabling the refusal. Behind a CDN, first restore the client's real address (set_real_ip_from, real_ip_header), otherwise geo evaluates the CDN's address.
sudo nginx -t && sudo systemctl reload nginx
Apache
Versions Apache 2.4.
In the virtual host configuration (Apache 2.4):
SetEnvIfNoCase User-Agent "(Googlebot|bingbot|GPTBot|OAI-SearchBot|ChatGPT-User|PerplexityBot|Perplexity-User|ClaudeBot|Claude-User|Claude-SearchBot)" robot_declare
<Directory "/var/www/example">
<RequireAny>
<RequireAll>
Require all granted
Require not env robot_declare
</RequireAll>
Include /etc/apache2/robots-verifies-require.conf
</RequireAny>
</Directory>
How to read it: any visitor that does not declare itself as a crawler gets through; one that declares itself as a crawler must come from a listed range, otherwise it receives a 403. Behind a proxy, enable mod_remoteip so that Require ip evaluates the client's address.
sudo apachectl configtest && sudo systemctl reload apache2
Cloudflare
Versions Cloudflare dashboard, all plans (number of lists depending on the plan), November 2026.
Cloudflare maintains its own list of verified bots and exposes the result in the cf.client.bot field. In Security > Security rules, a single custom rule is enough to block fake Googlebots and Bingbots:
((http.user_agent contains "Googlebot" or http.user_agent contains "bingbot") and not cf.client.bot)
Action: Block. To exempt verified bots from another rule, add and not cf.client.bot to it. The cf.verified_bot_category field lets you target a category, for example "Search Engine Crawler" or "AI Crawler".
Not all AI crawlers are verified bots at Cloudflare. For those that are not, create an IP list (Manage Account > Configurations > Lists) from the vendor's JSON file, then:
(http.user_agent contains "PerplexityBot" and not ip.src in $perplexitybot)
The number of custom lists depends on the plan. The AI Crawl Control page shows, for each AI crawler, the request volume and the action applied.
AWS
Versions AWS WAF (wafv2 API), AWS CLI v2 and console, November 2026.
In AWS WAF, create one IP set per crawler:
aws wafv2 create-ip-set \
--name openai-gptbot \
--scope CLOUDFRONT \
--region us-east-1 \
--ip-address-version IPV4 \
--addresses $(curl -s https://openai.com/gptbot.json | jq -r '[.prefixes[].ipv4Prefix | select(. != null)] | join(" ")')
For an Application Load Balancer, use --scope REGIONAL and the resource's region. Then, from the AWS WAF console, add a rule to the web ACL that blocks the name without the address:
{
"Name": "faux-gptbot",
"Priority": 10,
"Statement": {
"AndStatement": {
"Statements": [
{
"ByteMatchStatement": {
"SearchString": "gptbot",
"FieldToMatch": { "SingleHeader": { "Name": "user-agent" } },
"TextTransformations": [{ "Priority": 0, "Type": "LOWERCASE" }],
"PositionalConstraint": "CONTAINS"
}
},
{
"NotStatement": {
"Statement": {
"IPSetReferenceStatement": {
"ARN": "arn:aws:wafv2:us-east-1:123456789012:global/ipset/openai-gptbot/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
}
}
}
}
]
}
},
"Action": { "Block": {} },
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "faux-gptbot"
}
}
Keep the IP sets up to date with a scheduled Lambda function or a continuous integration job (aws wafv2 update-ip-set). The paid Bot Control managed rule group verifies common bots itself and applies the awswaf:managed:aws:bot-control:bot:verified label to those it has authenticated. Watch out for its CategoryAI rule, which blocks AI bots by default, even verified ones.
Plesk
Versions Plesk Obsidian 18.0 with nginx enabled.
Paste the Nginx configuration for the server block into Websites & Domains > Apache & nginx Settings > Additional nginx directives. The geo, map and log_format blocks, which belong to the http context, go into an /etc/nginx/conf.d/robots-verifies.conf file created by the server administrator.
Shared hosting
Without access to the server configuration, you have two options: put the site behind Cloudflare and use cf.client.bot, or settle for after-the-fact verification, running the addresses from your raw logs through the two scripts. Do not try to maintain hundreds of ranges by hand in a .htaccess file.
WordPress
Versions WordPress 6.4 to 7.1, Wordfence 7 and 8.
Wordfence verifies Googlebot's identity and offers to immediately block fake Google crawlers (Wordfence > Firewall > All Firewall Options > Rate Limiting). For AI crawlers, no common plugin keeps the official lists up to date in a documented way: perform the check at the server or CDN level.
Laravel
Versions Laravel 10 to 13. The middleware is the same everywhere; how it is registered changes from Laravel 11 onwards.
If the check cannot be done upstream, a middleware can refuse fake AI crawlers. The ranges are loaded in config/services.php (verified_bots.ranges key) from a file updated by a scheduled command:
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\IpUtils;
use Symfony\Component\HttpFoundation\Response;
class RejectSpoofedBots
{
private const string BOT_PATTERN = '/GPTBot|OAI-SearchBot|ChatGPT-User|PerplexityBot|Perplexity-User|ClaudeBot|Claude-User|Claude-SearchBot/i';
public function handle(Request $request, Closure $next): Response
{
if (! preg_match(self::BOT_PATTERN, (string) $request->userAgent())) {
return $next($request);
}
if (IpUtils::checkIp((string) $request->ip(), config('services.verified_bots.ranges', []))) {
return $next($request);
}
abort(403);
}
}
The typed constant requires PHP 8.3: on an earlier version, remove the string type. What remains is to register the middleware for all requests and to declare the trusted proxies, so that $request->ip() returns the client's address and not the CDN's. Replace 203.0.113.0/24 with the ranges of your CDN or load balancer. This is where the versions differ.
Laravel 11 to 13
Since Laravel 11, app/Http/Kernel.php and app/Http/Middleware/TrustProxies.php no longer exist: everything is configured in bootstrap/app.php.
use App\Http\Middleware\RejectSpoofedBots;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
// ->withRouting(...)
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: ['203.0.113.0/24']);
$middleware->append(RejectSpoofedBots::class);
})
// ->withExceptions(...)
->create();
Laravel 10
Add the middleware at the end of the $middleware array in app/Http/Kernel.php, after TrustProxies:
protected $middleware = [
\App\Http\Middleware\TrustProxies::class,
// ...
\App\Http\Middleware\RejectSpoofedBots::class,
];
Then declare the proxies in app/Http/Middleware/TrustProxies.php:
protected $proxies = ['203.0.113.0/24'];
Common mistakes
- Stopping at reverse DNS: without the forward lookup back, an attacker who controls the reverse DNS of their addresses passes the test.
- Accepting any
googleusercontent.com: this domain also covers Google Cloud customers' machines. - Freezing an address list: ranges change; a list copied once ends up blocking real crawlers.
- Enabling the refusal without an observation phase: log first, block afterwards.
- Evaluating the CDN's address: behind a proxy, without restoring the real address, the whole check runs on the wrong address.
- Blocking by IP a crawler you only want to exclude from training: it can no longer read the robots.txt file. Express that choice in robots.txt (opens in a new tab).
- Running a DNS lookup on every request: the server slows down for everyone.
Frequently asked questions
How do I verify that a Googlebot request is genuine?
Run a reverse DNS lookup on the request's IP address: the resulting name must end in googlebot.com or google.com. Then run a forward DNS lookup on that name: it must return the original address. This second step is essential, because anyone can declare any name for their own addresses. Google also publishes its IP ranges in JSON format.
How do I know whether a GPTBot request really comes from OpenAI?
OpenAI does not document reverse DNS verification, but publishes a JSON list of IP ranges per crawler: gptbot.json for GPTBot, searchbot.json for OAI-SearchBot, chatgpt-user.json for ChatGPT-User. A request that declares itself as GPTBot must come from a range in the matching list; otherwise, treat it as ordinary traffic. Reload these lists automatically, because they change without notice.
Should fake crawlers be blocked?
Yes, a request that carries a crawler's name without coming from its official addresses can be treated as ordinary traffic, and blocked if your policy calls for it. Start by logging these requests for a few days and check that no real crawler appears among them before enabling the refusal: an outdated address list would block real crawlers, which costs far more than a fake crawler.
Can the DNS check be run on every request?
No, a reverse DNS check on every request costs two DNS lookups and slows the server down for everyone. Reserve it for log analysis, or cache its result per address. For real-time checking, compare the address with the published range lists instead, loaded into the web server, the CDN or the firewall and reloaded every night.
Resources
- Google: verifying Googlebot and other Google crawlersdevelopers.google.com
- Bing Webmaster Tools: “Verify Bingbot” help and verification toolbing.com
- OpenAI: crawlers, user agents and IP address filesdevelopers.openai.com
- Perplexity: crawlers, IP address files and firewall configurationdocs.perplexity.ai
- Anthropic: Claude's crawlers and IP address listsupport.claude.com
- Cloudflare: verified bots and cf.client.bot fielddevelopers.cloudflare.com
- Nginx: geo modulenginx.org
- AWS WAF: IP setsdocs.aws.amazon.com
Updated on
Topic checklist (PDF)