The bouncer who only checks your zip code

Picture a nightclub bouncer who glances at your zip code, stamps your hand, and calls it a background check. That is the DNS Cookie. It is genuinely good at the one job it was hired for — and quietly disastrous the moment someone promotes the stamp to a passport.

Here is the trap in miniature. A household, an office or a carrier network pushes DNS traffic through a shared recursive resolver. The resolver reaches an anycast service, collects a Server Cookie, and later presents a valid one from the same public address. A downstream control system logs that cookie as proof the same customer made both requests. The protocol established something far narrower: the second request carries state the server can validate against the Client Cookie, the observed source address, its own secret and a time window. Everything else is inference wearing a lab coat.

What a DNS Cookie actually proves

RFC 7873 defines DNS Cookies as a lightweight DNS transaction-security mechanism. Their job is limited protection against denial-of-service amplification, answer forgery and cache poisoning by an attacker who cannot see the exchange. That off-path condition is not a footnote. It is the entire boundary of the assurance.

A first request carries an eight-byte Client Cookie. Once the server replies, later requests can include both the Client Cookie and the Server Cookie, letting the server reject or constrain traffic that cannot reproduce the state it issued. The mechanism deploys incrementally, survives NAT, and works for anycast services without demanding that every client on the Internet hold a pre-arranged credential. Those virtues are exactly why the RFC calls it a weak form of authentication rather than a client-identity system.

An on-path router, bridge, shared-link participant or any other observer that can read plaintext DNS traffic can also read the cookie. Within its usable lifetime, that observer can replay what it saw. The cookie raises the cost for an off-path forger. It does not convert an observable bearer value into proof of a human or an organisation.

The construction: address in, identity out

RFC 9018 makes the Server Cookie construction interoperable. Version 1 folds the Client Cookie, version and reserved fields, a timestamp and the client's source IP address under a Server Secret. The client IP is an input to the calculation even though it never travels inside the cookie value. The server verifies the result with the same secret.

That answers a precise server-side question: is this request consistent with a cookie previously produced for this Client Cookie and this observed address, under a valid secret and a live time window? It does not answer who is using the address. Many users share one recursive resolver. Many devices hide behind one NAT address. A resolver process can restart, rotate its Client Cookie or hop between addresses. Flip it around: one public address can stay rock-stable while the people and permissions behind it change completely.

Time, anycast and the illusion of continuity

Time is part of the evidence. RFC 9018 says the timestamp must be checked within a defined period and recommends accepting a window roughly one hour into the past and five minutes into the future; a server should renew a cookie once the received value is more than half an hour old. A valid timestamp limits replay. It is not a current authorization epoch for a subscriber account.

Anycast adds another distinction. Members of an anycast set need compatible Server Cookie construction and shared access to the secrets required to verify each other's output. RFC 9018 describes a three-stage rollover: distribute the new secret while still generating with the old one; begin generating with the new secret while validating both; then retire the old secret once clients have had time to renew. A cookie accepted by a different member proves the fleet shares a compatible validation state. It does not prove the same physical server, resolver instance or end user came back.

Privacy rules drive the point home. A client must mint a new Client Cookie when its source address changes, and the spec warns that a client behind NAT may never learn its public address moved. Cookie continuity is deliberately bounded by network context and implementation state. Treating it as a durable customer identifier fights the mechanism's own mobility and privacy assumptions.

TSIG is the stronger comparator — and still not a truth serum

The honest benchmark is RFC 8945, which defines TSIG. TSIG authenticates a DNS transaction with a message authentication code between entities that already share a configured secret, proving that a dynamic update or response came from an approved party holding that key. It demands key distribution, key protection and a named trust relationship — precisely the overhead DNS Cookies set out to avoid.

Even TSIG has a defined edge: it authenticates transmission between parties sharing a secret, not the truth or original provenance of every record. DNS Cookies cannot inherit TSIG's stronger party authentication just because both run keyed calculations. One is lightweight anti-forgery state built for broad deployment; the other is transaction authentication inside a pre-established trust relationship. A mechanism that records a fact is not the same as an institution that rules on it.

The four claims you must not compress

The operational error is squeezing four observations into a single identity flag. The Server Cookie may be valid. The source address may match the calculation. The request may still have crossed an observable path. The resolver may stand for thousands of users whose application permissions differ wildly. A rate limiter can use the cookie as one anti-abuse signal without ever declaring that it has authenticated a customer.

A useful DNS request-assurance receipt keeps the layers apart. It records the Client Cookie and Server Cookie version, timestamp and validation result; the source address the server observed; the responding anycast member; the active Server Secret epoch; the transport and whether an on-path observer could see the exchange; the resolver instance when known; any separately authenticated principal; the authorization policy; and the action time. It never stores the secret itself.

This preserves the mechanism's value. Valid cookies support rate limiting, shrink reflection opportunities and screen obviously forged requests before expensive controls fire. They also expose secret-rollover and anycast-consistency failures. The gain comes from making the evidence legible — not from promoting it beyond its threat model.

Sources

RFC 7873 — Domain Name System (DNS) Cookies; RFC 9018 — Interoperable DNS Server Cookies; RFC 8945 — Secret Key Transaction Authentication for DNS.