DANE for Mail Servers: Creating and Rolling Over TLSA Records
How DANE and TLSA records protect SMTP, how to choose usage, selector and matching type, and how to rotate keys without bounced mail.

Pinning a certificate in DNS
DANE, DNS-Based Authentication of Named Entities, lets a domain owner publish in DNS which certificate or public key a service must present. Because the record is protected by DNSSEC signatures, a client that validates DNSSEC can trust it without relying on the hundreds of public certificate authorities. For web browsing DANE never caught on, but for mail it is widely used: many European providers, Microsoft Exchange Online for outbound mail and a growing number of operators check TLSA records before delivering, and refuse to send over a connection that does not match.
Anatomy of a TLSA record
The owner name combines port, protocol and host, for example _25._tcp.mail.example.com for SMTP. The record has four fields. Certificate usage says what is pinned: 0 and 1 also require normal public CA validation, 2 pins a trust anchor in your chain, and 3 pins the server's own certificate or key. Selector says which part: 0 is the full certificate, 1 only the public key. Matching type says how: 0 the raw bytes, 1 a SHA-256 hash, 2 a SHA-512 hash. The data is the resulting value in hex.
For mail, RFC 7672 tells sending servers to ignore usages 0 and 1, so use 3 or 2. The combination 3 1 1, the SHA-256 hash of the server's public key, is the common recommendation. Many operators add 2 1 1 for the issuing CA as a backup, which keeps working when the server key changes as long as the server sends that CA certificate in its chain.
Generating records
The DANE TLSA Record Generator starts with the service. Pick a preset such as SMTP on port 25, enter the host name and TTL, then paste or open your fullchain.pem. The tool lists the certificates it found and computes the record for the parameters you choose, with plain advice: an error for usages 0 and 1 on mail ports, a note that selector 0 changes with every renewal, and a reminder that DANE-TA needs the CA in the served chain. You get the record as a zone file line, an nsupdate command and the separate values most DNS panels ask for, plus dig and openssl commands to test the result.
Rolling keys without bounces
The dangerous moment with DANE is a key change. If the server starts presenting a new key before resolvers have seen a matching TLSA record, DANE-validating senders will refuse your mail. The rollover tab handles this: paste the current and the next certificate, publish both records, wait at least two TTLs, switch the server, verify, and only then remove the old record. With 3 1 1 and a key that you keep across renewals, for example certbot's reuse-key option, routine certificate renewals need no DNS change at all.
Checking what is published
Paste the TLSA records that dig returns, or that your DNS panel shows, together with the chain the server actually uses. The check tab recomputes each record against every certificate and tells you which one it matches. If none match, a DANE sender would treat your server as broken, and fixing that comes before anything else.
Prerequisites and limits
DANE only works in a DNSSEC-signed zone, and your resolvers and those of your senders must validate it; without that the records are ignored. A browser page cannot query DNS, check DNSSEC or connect to your mail server, so verify with dig +dnssec and openssl s_client after publishing. Keep a monitor on the records, because an expired or mismatched TLSA record is a delivery outage, not just a warning.



