What reverse DNS actually is
Forward DNS maps a name to an address. Reverse DNS maps an address to a name, using a separate tree: in-addr.arpa for IPv4 and ip6.arpa for IPv6. An address is reversed and appended, so 66.249.66.1 becomes 1.66.249.66.in-addr.arpa.
The delegation is the part people miss. Reverse zones are delegated by netblock, not by domain. Whoever holds 66.249.0.0/16 controls the PTR records for every address inside it — regardless of what domains those addresses host. That is why the record can be trusted only when the forward side agrees.
Why a PTR alone proves nothing
An attacker who rents a /29 from any hosting provider gets control of the reverse zone for those eight addresses. They can set a PTR to crawl-66-249-66-1.googlebot.com — the string is valid, the record is real, and a filter that checks "PTR ends with googlebot.com" passes it straight through.
What they cannot do is publish an A record inside googlebot.com. So resolving the claimed name forward returns either their own address (which they could also set — this is the residual weakness) or something unrelated. When the forward answer is the address in front of you, the name and the address are under the same control. That is the confirmation.
FCrDNS still trusts DNS. An attacker who can poison a resolver, or who controls both a forward zone and a netblock while claiming a name in it, defeats it. In practice this is rare; what it is not is impossible. Treat FCrDNS as strong evidence, not proof.
The two queries, by hand
$ dig +short -x 66.249.66.1
crawl-66-249-66-1.googlebot.com.
$ dig +short crawl-66-249-66-1.googlebot.com A
66.249.66.1
Same address on both sides — confirmed. Now compare a real host that simply has a PTR with no bot convention:
$ dig +short -x 8.8.8.8
dns.google.
$ dig +short dns.google
8.8.8.8
8.8.4.4
Also confirmed: the name resolves forward to the address. That tells you the address belongs to Google's DNS infrastructure, which is true and useful, and tells you nothing about whether the client is a browser, a crawler or a script.
IPv6 works the same way with a longer name:
$ dig +short -x 2001:4860:4860::8888
dns.google.
Two things to watch in real data: addresses with no PTR at all (very common on cloud providers — a missing record is not suspicion, it is the default) and addresses with multiple PTR records. Accept a confirmation if any returned name resolves forward to the address; do not require all of them.
Implementing it in Node
The naive version is five lines. The production version adds timeouts, because a hanging resolver will hang your request handler with it.
const dns = require('dns').promises;
const resolver = new dns.Resolver({ timeout: 2500, tries: 2 });
const withTimeout = (p, ms) => Promise.race([
p,
new Promise((_, reject) => setTimeout(() => reject(new Error('dns timeout')), ms)),
]);
async function forwardConfirmed(ip) {
let names = [];
try {
names = await withTimeout(resolver.reverse(ip), 4000);
} catch {
return { confirmed: false, reason: 'no PTR' };
}
for (const name of names.slice(0, 2)) {
const addresses = [];
try { addresses.push(...await withTimeout(resolver.resolve4(name), 4000)); } catch {}
try { addresses.push(...await withTimeout(resolver.resolve6(name), 4000)); } catch {}
if (addresses.includes(ip)) return { confirmed: true, name };
}
return { confirmed: false, reason: 'forward mismatch', names };
}
forwardConfirmed('66.249.66.1').then(console.log);
// { confirmed: true, name: 'crawl-66-249-66-1.googlebot.com' }
Note the address comparison. Normalise before you compare: dns.resolve6 can return the expanded form 2001:4860:4860:0000:0000:0000:0000:8888 for an address you hold as 2001:4860:4860::8888, and a string comparison will call a real crawler fake. Use new net.BlockList() or a BigInt comparison over the 128-bit value.
The same logic in a shell one-liner, useful for quick checks:
ip=66.249.66.1
name=$(dig +short -x "$ip" | head -1 | sed 's/\.$//')
dig +short "$name" | grep -qx "$ip" && echo "confirmed: $name" || echo "not confirmed"
Where the check fails
Four situations produce a false negative — a real crawler that fails the check:
- No PTR published. OpenAI, Perplexity and DuckDuckGo do not maintain a reverse-DNS convention; their ranges are the only evidence. Using FCrDNS as the sole check will mark them all as fake.
- PTR under a different suffix. Cloud and CDN providers sometimes name the block, not the customer. A real crawler on rented infrastructure may resolve to
ec2-…amazonaws.com. - IPv6 without reverse delegation. Many blocks never get an
ip6.arpazone at all. - A CNAME in the reverse zone. Discouraged by RFC 1912 and inconsistently supported; some resolvers follow it, some refuse.
And one false positive worth knowing: any hosting customer can point their PTR at a name they control and resolve it back to themselves. FCrDNS proves the name and address are under one operator. It does not prove the operator is the one the name suggests — unless the name sits inside the operator's own domain, which is exactly the case for googlebot.com, search.msn.com and applebot.apple.com.
Caching and cost
Two DNS round trips per request is not viable in a request path. Cache the verdict, not the query: key on the address, keep it for an hour, and limit the cache size. PTR records change on the order of days, so an hour is conservative.
const cache = new Map(); // ip -> { value, expires }
const TTL = 60 * 60 * 1000;
async function cachedConfirm(ip) {
const hit = cache.get(ip);
if (hit && hit.expires > Date.now()) return hit.value;
const value = await forwardConfirmed(ip);
if (cache.size > 10000) cache.clear(); // crude, predictable bound
cache.set(ip, { value, expires: Date.now() + TTL });
return value;
}
This is the same structure the bot verifier uses, with the ranges check layered in first: if the address is inside a published operator range, the DNS question is already answered and no lookup is needed for the verdict — though the PTR is still shown, because it is useful when you are reading logs by hand.