Summary

  • RFC 5782, February 2010, records that "the DNS has become the de-facto standard method of distributing these blacklists and whitelists", and defines the encoding: the 192.0.2.99 listed in bad.example.com is 99.2.0.192.bad.example.com, with an A record whose "contents MUST NOT be used as an IP address" and, conventionally, a TXT record giving the reason.
  • The same memo makes absence mean something: "if an IP address is not listed in the DNSxL, there MUST NOT be any records for the address". RFC 6471 then wrote down the practice rules for the people publishing the lists — no unprovoked scanning, rescans no more than daily, and a direct non-public way to ask for removal.

The address book got a second question

The Domain Name System was built to answer one question well: given a name, what is the address? Reverse zones added the mirror image, and by 2010 a corner of the DNS was answering a different question entirely — given an address, what do we think of it?

The reason is in the first sentence of RFC 5782. Spam and other antisocial behaviour produced shared blacklists and whitelists, and the DNS "has become the de-facto standard method of distributing" them. It is an odd promotion. A protocol designed for stable, cacheable facts was being used to publish opinions that change as often as the behaviour they describe.

The encoding is the whole trick

Section 2.1 borrows the reverse zone's shape and reuses it for the verdict. Take the address, reverse the octets, append the list's domain. For 192.0.2.99 in bad.example.com, the entry is 99.2.0.192.bad.example.com.

Then come the two constraints that make the format work. Each entry "MUST have an A record", and "the contents of the A record MUST NOT be used as an IP address" — the conventional value is 127.0.0.2, a loopback address that cannot be mistaken for a real destination. And a DNSBL "SHOULD" carry a TXT record that describes the reason, often with a URL, because that text "is often used as the text of an SMTP error response".

That is a neat arrangement. The A record answers existence, the TXT record answers why, and the convention that the address field is meaningless stops anyone from dialling the verdict.

Sublists show the same economy. A list that distinguishes sender policy from open relays from compromised hosts uses subdomains, multiple A records, or bit-encoded entries — and lists with sublists "SHOULD use both subdomains and one of the other methods". The reason bit-encoding works at all is that the A record's contents were declared meaningless: 127.0.0.x can carry a small code because nobody is supposed to treat it as a place.

IPv6 gets the same treatment with a 32-component nibble-reversed name. A single IPv6 address produces a hostname long enough to show the formalism clearly, and the same A-and-TXT reading applies.

Absence is a state the protocol must be able to express

The most important sentence in section 2.1 is about what happens when the answer is no. If a range is listed, every address in the range needs a record. And "if an IP address is not listed in the DNSxL, there MUST NOT be any records for the address."

That sounds like bookkeeping. It is actually the difference between a verdict and a fault. A mail server asking about an address has to distinguish "not listed" from "the list did not answer", and the memo's rule is what makes the first of those unambiguous. Everything after that — the timeout, the retry, the decision to accept or reject when the query fails — depends on the consumer, not the publisher.

Section 2.2 adds a second asymmetry. Whitelists barely need explanations, because "SMTP has no way for a server to advise a client why a request was accepted". The same list can also be read two ways: one network's list of dynamic addresses can be a whitelist on its own outgoing mail server and a blacklist to everyone else. The zone does not say which reading is intended; the reader decides.

Guidelines for people who publish verdicts

RFC 6471, January 2012, is the companion piece: how to run a public list, and how to use one. Its abstract is careful to say it is "not intended to advise on the utility or efficacy of particular DNSBLs or the DNSBL concept in general".

The operational content is where the institutional bargain shows. A listees' side gets a route back: "A Direct Non-Public Way to Request Removal SHOULD Be Available", alongside whatever public argument happens in a forum. The scanning side gets limits: "DNSBLs MUST NOT automatically probe for insecure hosts without provocation", and scanning must be "targeted, rather than broad-based", motivated by a delivery, a spam-trap hit, a complaint, or a recheck of an address already listed. Rescans should not run more often than once every 24 hours, and should cease when the vulnerability is gone.

Read those together and the shape of the arrangement is plain. The publisher of a verdict is asked to have evidence, a reason, a limit on how hard it looks, and a way to be asked again. None of that is enforced by the DNS. It is enforced, when it is enforced at all, by mail administrators choosing whose answers to trust.

Two protocols in one question

A DNS query is cheap, cached and everywhere; that is why the verdicts moved there. It is also why the verdicts are hard to audit. A cached opinion looks exactly like a cached fact, both arrive with a TTL, and the consumer has to remember which one it asked for.

That is the trade the format made. The address book became the cheapest distribution channel available for a judgment about an address, and the judgment inherited the address book's tone: terse, numeric, confident, and impossible to distinguish from a record by shape. The A record that must not be read as an address is the clearest sign of the compromise. It is a field everyone can query, whose content nobody is allowed to believe as data.