# Anyone can call themselves CCBot. Here's the 30-line check that tells the real one apart

> Source: <https://dev.to/tommy2970/anyone-can-call-themselves-ccbot-heres-the-30-line-check-that-tells-the-real-one-apart-2icp>
> Published: 2026-12-04 08:11:38+00:00

**Recommendation:** When gating access or analytics on crawler identity, check the operator's published IP ranges plus FCrDNS, and cache both since the JSON and DNS answers change rarely.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

A user agent is a string. Anyone can type it.

On my site, 610 requests have said "I'm CCBot", Common Crawl's crawler, since the logs began (counted 3 December 2026). Only 358 of them actually were. The other 252 came from 44 addresses that have nothing to do with Common Crawl, and they weren't crawling: they were asking for `/.bash_profile`, `/docker-compose.yaml`, `/proc/self/cmdline`. That's a scanner wearing a crawler's badge, hoping you whitelisted the badge.

If your analytics, your firewall rules or your "AI bots visited us" chart trust the user agent, you're counting those 252 as Common Crawl.

I wrote to them on 2 December with the numbers. An engineer answered the same day:

"Sadly, many instances of CCBot impersonation have been observed for quite some time. Yes, you can use RDNS to verify whether a request comes from the real CCBot. This is covered in our FAQ and also on the CCBot page."

So there are two official methods:

`crawl.commoncrawl.org`, and that name resolves back to the same IP. Reverse DNS alone isn't enough: whoever owns an IP can point its reverse record at any name they like. The forward lookup is what closes the loop.
On my logs both methods give the same verdict, request by request: 358 real, 252 not. Not one of the fakes passes either check.

Google publishes its crawler ranges in the same JSON shape (`prefixes` → `ipv4Prefix` / `ipv6Prefix`), so the same function works for both; only the URL and the DNS suffix change.

``` python
import ipaddress, json, socket, sys, urllib.request

def in_list(ip, url):
    """Is the IP inside one of the prefixes the operator publishes?"""
    data = json.load(urllib.request.urlopen(url, timeout=15))
    addr = ipaddress.ip_address(ip)
    for p in data["prefixes"]:
        net = p.get("ipv4Prefix") or p.get("ipv6Prefix")
        if addr in ipaddress.ip_network(net):
            return True
    return False

def fcrdns(ip, suffixes):
    """Forward-confirmed reverse DNS: IP -> name -> same IP."""
    try:
        name = socket.gethostbyaddr(ip)[0]
    except OSError:
        return False, None
    if not name.endswith(suffixes):
        return False, name
    try:
        forward = {a[4][0] for a in socket.getaddrinfo(name, None)}
    except OSError:
        return False, name
    return ip in forward, name

if __name__ == "__main__":
    ip = sys.argv[1]
    print("in ccbot.json:", in_list(ip, "https://index.commoncrawl.org/ccbot.json"))
    print("FCrDNS:", fcrdns(ip, (".crawl.commoncrawl.org",)))
bash
$ python verify_crawler.py 18.97.14.84
in ccbot.json: True
FCrDNS: (True, '18-97-14-84.crawl.commoncrawl.org')

$ python verify_crawler.py 8.8.8.8
in ccbot.json: False
FCrDNS: (False, 'dns.google')
```

In production, cache the JSON (it changes rarely) and the DNS answers. Don't do two lookups on every hit.

The whole thing (verified vs unconfirmed crawlers on one small site, monthly, CC BY 4.0) is on Zenodo: [https://doi.org/10.5281/zenodo.24628027](https://doi.org/10.5281/zenodo.24628027). Live numbers: [https://stats.lake8.dev](https://stats.lake8.dev). It's one site, so read it as a sample, not a census.

How do you verify bots on your side, list, reverse DNS, or not at all?
