CrawlClick docs
Menu and search

Verify AI crawlers with forward-confirmed reverse DNS

Forward-confirmed reverse DNS proves a crawler's address belongs to its vendor by resolving the address to a hostname with the vendor's suffix and resolving that hostname back to the same address; CrawlClick implements it but its production edge uses published IP ranges instead.

Status: Live. Reverse DNS on its own proves nothing, because whoever controls an address block controls its PTR records and can point them at any name. Forward-confirmed reverse DNS (FCrDNS) closes that gap: the name must also resolve forward, in the vendor’s own zone, to the address the request came from. This page gives the rules CrawlClick’s crawler-id crate applies, code in Node and Go that follows them, and the reason the production edge does not run it.

How does forward-confirmed reverse DNS work?

Three lookups, and all three must agree:

  1. Reverse. Look up the PTR records for the connecting address. For an IPv4-mapped IPv6 address such as ::ffff:66.249.66.1, look up the IPv4 address.
  2. Suffix. Lower-case each name, drop a trailing dot, and keep the first one that ends with one of the vendor’s suffixes. The registry’s suffixes begin with a dot (.googlebot.com), so a look-alike such as crawl.evilgooglebot.com does not match.
  3. Forward. Resolve that name to its A and AAAA records. The original address must be among them.

You can walk through it by hand with host from a shell:

host 66.249.66.1
# 1.66.249.66.in-addr.arpa domain name pointer crawl-66-249-66-1.googlebot.com.
host crawl-66-249-66-1.googlebot.com
# crawl-66-249-66-1.googlebot.com has address 66.249.66.1

The name ends in .googlebot.com and resolves back to the address, so the request came from Google’s crawler network.

Which AI crawlers publish reverse-DNS hostnames?

8 of the 29 agents in the registry publish hostname suffixes. The suffixes come from each vendor’s own documentation, linked from the agent’s page.

AgentHostname suffixesAlso publishes IP ranges?
Applebot.applebot.apple.comYes
bingbot.search.msn.comYes
CCBot.crawl.commoncrawl.orgYes
Google-Agent.gae.googleusercontent.com, .google.comYes
Google-CloudVertexBot.google.com, .googlebot.comYes
Googlebot.googlebot.com, .google.comYes
GoogleOther.google.com, .googlebot.comYes
Kagibot.kagibot.orgNo

What rules does CrawlClick’s verifier apply to reverse DNS?

The FCrDNS check in the API’s verify.rs reaches the rdns tier: rank 4, above ip_range and below signature, with a confidence of 0.98. It runs only for an agent whose registry entry lists suffixes, and only when a DNS resolver is supplied. It separates outcomes that contradict the claim from outcomes that merely fail:

Outcome Result Authoritative?
A PTR name has an allowed suffix and resolves forward to the address Confirmed: rdns tier —
The reverse lookup returns no PTR names Refuted Yes
No PTR name ends with an allowed suffix Refuted Yes
The forward lookup does not include the address Refuted Yes
The reverse or forward lookup errors Neither No

Only the first PTR name with an allowed suffix is forward-checked, and addresses are compared after unmapping IPv4-mapped IPv6 on both sides. An authoritative refutation marks the request as a suspected spoof, which overrides any other method’s confirmation, as described on Verification tiers. A DNS error is not evidence: a resolver timeout must not turn a genuine crawler into a spoof.

Why does CrawlClick’s production edge not use reverse DNS?

The reasons are in the trade-off. FCrDNS costs two DNS round trips for every new address, on the request path, and its answer depends on a resolver being up. A published range file costs one fetch per vendor per refresh and an in-memory lookup per request, and reaches the same verified bar. Every ad-eligible agent that publishes suffixes also publishes a range file, so production loses no agent it could bill.

The exception is an agent that publishes hostnames and nothing else.

In the current registry that is Kagibot. CrawlClick's production edge cannot verify it.

If you run your own bot rules, FCrDNS is still a sound check for such agents; cache the verdict per address.

How do I check forward-confirmed reverse DNS in Node?

This version follows CrawlClick’s rules, including the difference between a refutation and a failed lookup, and caches verdicts per address. Pass the suffixes from the agent’s rdns_suffixes in /crawlers.json. The per-agent pages in the crawler reference carry a shorter version with each agent’s suffixes filled in.

// fcrdns.mjs — Node 22 or later. Forward-confirmed reverse DNS with the rules CrawlClick's verifier uses.
import { promises as dns } from 'node:dns';
import { BlockList, isIP } from 'node:net';

const resolver = new dns.Resolver({ timeout: 2000, tries: 2 });
const NOT_FOUND = new Set(['ENOTFOUND', 'ENODATA']);

/**
 * Resolves to { result, detail }, where result is:
 *   'rdns'        — a PTR name with an allowed suffix resolves back to the address
 *   'refuted'     — no PTR, no name with an allowed suffix, or a forward lookup without the address
 *   'no-evidence' — a lookup failed (timeout, SERVFAIL): retry later, do not treat it as a spoof
 */
export async function fcrdns(ip, suffixes) {
  const mapped = /^::ffff:(\d+\.\d+\.\d+\.\d+)$/i.exec(ip);
  const addr = mapped ? mapped[1] : ip;
  const family = isIP(addr);
  if (family === 0) return { result: 'refuted', detail: `not an IP address: ${ip}` };

  let names = [];
  try {
    names = await resolver.reverse(addr);
  } catch (err) {
    if (!NOT_FOUND.has(err.code)) return { result: 'no-evidence', detail: `reverse DNS failed: ${err.code}` };
  }
  if (names.length === 0) return { result: 'refuted', detail: `no PTR record for ${addr}` };

  // Only the first name with an allowed suffix is forward-checked.
  const host = names
    .map((n) => n.toLowerCase().replace(/\.$/, ''))
    .find((h) => suffixes.some((s) => h.endsWith(s.toLowerCase())));
  if (!host) return { result: 'refuted', detail: `PTR ${names.join(', ')} matched no suffix` };

  const answers = await Promise.allSettled([resolver.resolve4(host), resolver.resolve6(host)]);
  const failed = answers.filter((a) => a.status === 'rejected' && !NOT_FOUND.has(a.reason.code));
  if (failed.length === answers.length) {
    return { result: 'no-evidence', detail: `forward DNS failed for ${host}: ${failed[0].reason.code}` };
  }
  const forward = new BlockList();
  for (const a of answers) {
    if (a.status !== 'fulfilled') continue;
    for (const address of a.value) forward.addAddress(address, isIP(address) === 6 ? 'ipv6' : 'ipv4');
  }
  return forward.check(addr, family === 6 ? 'ipv6' : 'ipv4')
    ? { result: 'rdns', detail: host }
    : { result: 'refuted', detail: `forward lookup for ${host} does not return ${addr}` };
}

// Cache per address: two DNS round trips are too slow to repeat on every request.
const cache = new Map();
const TTL_MS = 60 * 60 * 1000;

export async function cachedFcrdns(ip, suffixes) {
  const key = `${ip}|${suffixes.join(',')}`;
  const hit = cache.get(key);
  if (hit && hit.expires > Date.now()) return hit.verdict;
  const verdict = await fcrdns(ip, suffixes);
  // Do not cache a failed lookup: the next request should try again.
  if (verdict.result !== 'no-evidence') cache.set(key, { verdict, expires: Date.now() + TTL_MS });
  return verdict;
}

dns.Resolver sends queries to DNS servers directly, so /etc/hosts cannot answer the forward step. Node reports an address with no PTR record as ENOTFOUND; the code treats that, and ENODATA, as “no record” and every other error code as a failed lookup.

How do I check forward-confirmed reverse DNS in Go?

A package for Go 1.21 or later, standard library only. net.DNSError.IsNotFound separates “no such record” from a failed lookup, and netip.Addr.Unmap handles IPv4-mapped addresses.

// Package fcrdns checks forward-confirmed reverse DNS with the rules CrawlClick's verifier uses.
// Go 1.21 or later, standard library only.
package fcrdns

import (
	"context"
	"errors"
	"net"
	"net/netip"
	"strings"
)

type Result string

const (
	Confirmed  Result = "rdns"        // PTR name has an allowed suffix and resolves back to the address
	Refuted    Result = "refuted"     // the vendor's DNS contradicts the claim: treat as a spoof
	NoEvidence Result = "no-evidence" // a lookup failed; retry later, do not treat as a spoof
)

func notFound(err error) bool {
	var dnsErr *net.DNSError
	return errors.As(err, &dnsErr) && dnsErr.IsNotFound
}

// Check runs PTR -> suffix -> forward lookup for ip. suffixes come from the registry entry's
// rdns_suffixes, which start with a dot so a look-alike domain cannot match.
func Check(ctx context.Context, r *net.Resolver, ip netip.Addr, suffixes []string) (Result, string) {
	ip = ip.Unmap()
	names, err := r.LookupAddr(ctx, ip.String())
	if err != nil && !notFound(err) && len(names) == 0 {
		return NoEvidence, "reverse DNS failed: " + err.Error()
	}
	if len(names) == 0 {
		return Refuted, "no PTR record for " + ip.String()
	}
	host := ""
	for _, name := range names {
		h := strings.TrimSuffix(strings.ToLower(name), ".")
		for _, s := range suffixes {
			if strings.HasSuffix(h, strings.ToLower(s)) {
				host = h
				break
			}
		}
		if host != "" {
			break // only the first matching name is forward-checked
		}
	}
	if host == "" {
		return Refuted, "PTR " + strings.Join(names, ", ") + " matched no suffix"
	}
	addrs, err := r.LookupNetIP(ctx, "ip", host)
	if err != nil && !notFound(err) {
		return NoEvidence, "forward DNS failed for " + host + ": " + err.Error()
	}
	for _, a := range addrs {
		if a.Unmap() == ip {
			return Confirmed, host
		}
	}
	return Refuted, "forward lookup for " + host + " does not return " + ip.String()
}

Call it with a bounded context so a slow resolver cannot stall a request:

ctx, cancel := context.WithTimeout(r.Context(), 2*time.Second)
defer cancel()
peer := netip.MustParseAddrPort(r.RemoteAddr).Addr()
result, detail := fcrdns.Check(ctx, net.DefaultResolver, peer, []string{".googlebot.com", ".google.com"})

What should I check before trusting reverse DNS?

  • Use the connecting address, never a client-supplied X-Forwarded-For. Behind a CDN, use the address the CDN reports from its own connection.
  • Keep the dot at the start of every suffix. Comparing against googlebot.com without it would accept evilgooglebot.com.
  • Cache verdicts, and expire them. Vendors reassign addresses; an hour is a reasonable lifetime.
  • Prefer a stronger method when one exists. A published range file needs no DNS, and a Web Bot Auth signature binds the request itself. The crawler registry records which methods each agent supports.