DEV Community

Tommy
Tommy

Posted on AI-assisted

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

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 asked Common Crawl how they want it checked

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:

  1. The published IP list: https://index.commoncrawl.org/ccbot.json
  2. Forward-confirmed reverse DNS (FCrDNS): the IP resolves to a name under 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.

The 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.

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",)))
🏆 ยอดนิยม: tommy/anyone can call themselves ccbot heres the line check that tells the real one apart icp - ประเด็นร้อน 🏆 ยอดนิยม: tommy/anyone can call themselves ccbot heres the line check that tells the real one apart icp - ประเด็นร้อน
$ 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')
🏆 ยอดนิยม: tommy/anyone can call themselves ccbot heres the line check that tells the real one apart icp - ประเด็นร้อน 🏆 ยอดนิยม: tommy/anyone can call themselves ccbot heres the line check that tells the real one apart icp - ประเด็นร้อน

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

Two things I learned doing this

  • Don't throw the fakes away. They aren't Common Crawl, but they're still traffic with intent, and the volume is growing. I keep them as their own class, "unconfirmed", instead of deleting them or lumping them in.
  • Note that CCBot's IPv6 addresses have no reverse DNS, per Common Crawl's own page. For IPv6, the list is the check.

The data

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. Live numbers: 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?

Top comments (0)