The lock was cheap, and everybody knew it

A DNS resolver asks a question and waits. Off the path, an attacker who never saw the question shouts an answer at the door and hopes the lock is cheap. For most of the DNS's life the lock was a 32-bit transaction ID — about 4.3 billion combinations, and cheap enough that Dan Kaminsky's 2008 cache-poisoning demonstration turned resolver randomisation into an industry emergency and RFC 5452 into its written rulebook.

In May 2016, two engineers named Donald Eastlake 3rd and Mark Andrews published RFC 7873, which added a second lock: a 64-bit DNS Cookie, roughly 18.4 quintillion combinations, carried as an EDNS(0) OPT option and returned only to the address that earned it.

The document calls itself “a lightweight DNS transaction security mechanism” and offers “limited protection to DNS servers and clients” against denial-of-service, amplification and cache-poisoning attacks “by off-path attackers.” A security standard that advertises its own smallness is either very confident or very honest. RFC 7873 is both — which is why it has survived a decade of partial deployment, a 2021 rewrite of its weakest part, and the complete indifference of everyone who is not a DNS engineer.

RFC 7873: two authors, one OPT option, and a very old problem

Eastlake, then at Huawei, and Andrews, at ISC, were not inventing a threat. They were writing down a defence the operational community had been circling for years: give the client and the server a shared value that a blind attacker cannot see, and widen the guess beyond the transaction ID alone.

The mechanism is deliberately unglamorous. The client puts an eight-byte Client Cookie in the query. The server answers with a Server Cookie of eight to thirty-two bytes, derived from a server secret and the client's address. On the next query the client echoes both, and a server that recognises its own cookie knows the client has already received a valid answer at that address — not merely that someone can spoof it.

No new port. No new protocol. No flag day. The whole thing rides inside an OPT record that older servers are already required to ignore gracefully.

The attacker who cannot see the query

The threat model explains the design. An on-path attacker sees everything and wins by default. An off-path attacker sees nothing: not the query, not the answer, not the resolver's source port. To poison a cache, that attacker must fire forged responses into the dark and hope one lands inside the window, with the right transaction ID, at the right microsecond.

Every bit of unpredictability the resolver adds is a bit the attacker must guess. Cookies add sixty-four, and they add them in a form that cannot be harvested by simply asking, because the Server Cookie is bound to the client's address and to a secret the server never publishes.

Sixty-four bits, honestly counted: DNS Cookies versus TCP

The document does not oversell. It compares itself to TCP, where an attacker must guess “the 32-bit TCP sequence number,” and notes that with cookies the guess becomes “a 64-bit pseudorandom ‘cookie’ quantity.”

Two to the thirty-second is about 4.3 billion. Two to the sixty-fourth is about 18.4 quintillion. That is not a revolution; it is a four-billion-fold widening of a blind attacker's search space, delivered in a sentence that refuses to call itself a revolution.

That restraint is why the mechanism survived review. Security documents that claim more than their bit counts are the ones deployments learn to distrust, and the DNS has a long memory for both.

The sentence that is both the feature and the flaw: voluntary adoption

Here is the heart of RFC 7873, and the reason it doubles as a case study in how the Internet actually ships things:

“If only one party to a DNS transaction supports DNS Cookies, the mechanism does not provide a benefit or significantly interfere, but if both support it, the additional security provided is automatically available.”

That is engineering diplomacy of a high order. Nothing needs to be negotiated globally. No version number moves. An old resolver keeps working exactly as before, and a new one gets protection the moment its counterparty catches up.

It is also a permanent excuse. A mechanism that costs nothing to ignore will be ignored by everyone who does not have an incident on their desk this quarter. The benefit arrives only at the far end of a deployment curve nobody is required to climb — and, as it turns out, nobody is measuring.

Lu Heng made the general case in his Note on minimum specification, localised future decision and voluntary adoption: “A proposal is not reality. A recommendation is not reality. A document is not reality.” Change becomes real only when running systems — and their counterparties — accept it. RFC 7873 is that argument in its purest form, and its purest test.

A cookie that cannot follow you home: DNS Cookies and privacy

The name invites the obvious suspicion, and the specification kills it in a single clause: because cookies “are only returned to the IP address from which they were originally received, they cannot be used to generally track Internet users.”

That is a design decision with a bill attached. Behind a large NAT, hundreds or thousands of clients look like one address, so they share one Server Cookie; the mechanism trades per-client distinction for a privacy claim it can actually keep. It is the opposite of the usual trade, and worth noticing.

When the server decides not to play: BADCOOKIE and rate limits

A client that sends a cookie to a server which ignores it loses nothing but the protection. A server that receives only a Client Cookie has a small menu: discard the request silently, answer with a BADCOOKIE error, or process it normally under its own policy and rate limits.

Leaving that choice to the operator is the same philosophy throughout: state what the mechanism makes possible, then let the person who owns the servers decide how much of it to require. It is not a mandate. It was never meant to be one.

The 2021 patch: when the Server Cookie stopped speaking in dialects

RFC 7873 left the Server Cookie's contents opaque, which let every implementation compute it however it liked — and made it impossible for servers sharing an address to validate each other's cookies. Anycast and load-balanced fleets noticed. A client could collect a perfectly valid cookie from one machine and be rejected by the next.

Nearly five years later, in April 2021, Ondřej Surý and Willem Toorop published RFC 9018, which updated RFC 7873 by specifying the Server Cookie's structure: a one-byte version, three reserved bytes, a four-byte timestamp and an eight-byte hash, sixteen bytes in total. The timestamp is the clever part — it lets servers that share a secret validate each other's cookies, which is exactly what an anycast fleet needs.

Note what did not change. The option stayed optional. The bit count stayed sixty-four. The privacy rule stayed. And the Internet's habit of shipping a fix, then shipping a fix for the fix, stayed exactly as it was.

What a modest standard is actually for

RFC 7873 is a good specimen of incremental Internet security: cheap, bilateral, honest about the number of bits it adds, and careful not to become a tracking system on the way through. It will never be cited in a keynote. It will simply be there, in the OPT record of every cookie-aware query, quietly raising the price of a blind guess.

Its limits are the point. A mechanism that claims only limited protection can be deployed by cautious operators without a business case; a mechanism that cannot follow users is one privacy reviewers never have to fight. Modesty is not a compromise here. It is the shipping strategy.

And the bill for that strategy is the sentence in the middle of the document: if only one side shows up, nothing happens. The DNS Cookie is a lock that only turns when both sides hold the key. Sixty-four bits will not save the DNS. They will only make the wrong answer harder to guess — which, for a system that has always run on guessing, is what progress looks like.