TLSA record generator: how do you build a DANE TLSA record from a certificate?
How does this check work, and what does the result tell you?
AdminKit's TLSA record generator turns a PEM certificate you paste into a DANE TLSA record (RFC 6698), by default 3 1 1: a SHA-256 hash of the server's public key, the choice RFC 7672 recommends for SMTP. It prints the zone-file line and the name/value split in your browser; nothing is sent to any server.
Part of the Email authentication cluster — more tools, guides and terms on email authentication.
The TLS server's name, e.g. the MX host mail.example.com.
Your domain at the DNS host; used only to show the short Name panels ask for.
25 for SMTP between mail servers, 443 for HTTPS.
tcp for SMTP and HTTPS.
Paste the BEGIN CERTIFICATE block (cert.pem, or the first block of fullchain.pem). Certificates only: never paste the private key.
Built entirely in your browser — nothing you paste is sent to AdminKit or any other server, and this tool does no DNS lookup.
TLSA DANE-EE SPKI SHA2-256 from the certificate (EC key)
TLSA only takes effect in a DNSSEC-signed zone. Before you change the server's key, publish a record for the new key next to this one and wait at least two TTLs, or validating clients will reject the new certificate.
What the result means
The zone-file line is one TLSA record: the owner name built from the port, transport and host, then the certificate usage, the selector, the matching type and the certificate association data in hex. The name and value fields are the same record split the way most DNS hosting panels ask for it.
Next step
Publish the record at your DNS host and make sure the zone is DNSSEC-signed, then check the zone with AdminKit's DNSSEC check. Without a signed zone, clients ignore TLSA records.
Keep this result
Copy a link to this check so you can share it or run it again later. Want a heads-up when this result changes? Talk to our team and we'll set it up for you.
How it works and limits
Type the host name, pick the port, paste the server certificate in PEM form, and this tool builds the TLSA record as you type, entirely in your browser — nothing you paste is sent to AdminKit or any other server, and no DNS query is made. It shows the zone-file line and the name and value boxes most DNS hosting panels ask for. Building the record changes nothing by itself: TLSA only takes effect in a DNSSEC-signed zone, and the record must be updated before the server’s key is rolled over.
What is a TLSA record for?
A TLSA record publishes, in DNS, which certificate or public key a TLS server is supposed to present.
RFC 6698 defines it as part of DANE, and a client that validates the
record with DNSSEC can reject a certificate that does not match, whichever certificate authority signed it. The
record lives at a name built from the port, the transport and the host; RFC 6698 gives
_25._tcp.mail.example.com as the example for an SMTP server on port 25. For the example certificate this tool
starts with, the record is:
_25._tcp.mail.example.com. IN TLSA 3 1 1 ff084d3162b6da745acd4790ae4b4d11b4327237430298871d2d89c9ab356024
Its main use today is mail. RFC 7672 defines how sending mail servers
use TLSA records on the receiving MX host to require STARTTLS and check its certificate, which stops a network
attacker from stripping TLS off the connection. The DANE/TLSA glossary entry explains the
idea in plain language, and the guide on
verifying DANE/TLSA for a mail server covers how to check a
published record with dig and openssl s_client.
Which usage, selector and matching type should I pick?
The three numbers before the hex are the certificate usage, the selector and the matching type. RFC 7218 gave them the names this tool shows next to each number.
| Field | Values |
|---|---|
| Certificate usage | 0 PKIX-TA, 1 PKIX-EE, 2 DANE-TA, 3 DANE-EE |
| Selector | 0 Cert (whole certificate), 1 SPKI (public key only) |
| Matching type | 0 Full (no hash), 1 SHA2-256, 2 SHA2-512 |
- 3 1 1 (the default). DANE-EE pins the server’s own key; per RFC 7671 the client then ignores the CA, the names and the validity dates in the certificate. RFC 7672 recommends 3 1 1 for SMTP, and the Postfix TLS documentation calls 3 1 1 the best practice because the record keeps working when a certificate is renewed with the same key pair.
- 2 1 1 or 2 0 1. DANE-TA pins the CA that issued your certificate instead. Paste that CA certificate, not the server’s, and make sure the server sends it in its chain, which RFC 7671 requires for usage 2. RFC 7672 names 2 0 1 as the second choice for SMTP, and RFC 7671 says DANE-TA records should use selector 0. 2 1 1 hashes only the CA’s public key, so it keeps matching if the CA certificate is reissued with the same key.
- Usages 0 and 1. These add normal public-CA validation on top of the TLSA match. RFC 7672 says TLSA records for port 25 SHOULD NOT use them, because sending mail servers have no agreed list of trusted CAs. They are rarely right for SMTP; the tool warns when you combine them with port 25.
- Matching type. SHA-256 (1) is the usual choice. SHA-512 (2) works the same way with a longer digest. Full (0) puts the whole certificate or key in DNS, which makes large responses.
For a mail server with several certificates, for example one RSA and one ECDSA, publish one record per certificate under the same name: Postfix’s documentation says the published TLSA records must match all of the certificate chains the server is configured with.
How do I get the same hash with OpenSSL?
The tool’s 3 1 1 value is the SHA-256 of the DER-encoded SubjectPublicKeyInfo inside the certificate. The
-pubkey option of openssl x509 prints that block, so this
pipeline gives the same hex for a certificate in cert.pem:
openssl x509 -in cert.pem -pubkey -noout | openssl pkey -pubin -outform DER | openssl dgst -sha256
For 3 0 1, hash the whole certificate instead:
openssl x509 -in cert.pem -outform DER | openssl dgst -sha256
On a Postfix server, the postfix-tls(1) manual documents
postfix tls output-server-tlsa, which writes a TLSA record set for a port 25 SMTP server from the configured
key files. This tool’s unit tests compare its output with the OpenSSL pipeline above for locally generated test
certificates.
What happens when the certificate is renewed?
It depends on what the record pins. A certificate renewed with a new key no longer matches a 3 1 1 record, and a
renewed certificate never matches a 3 0 1 record, because any change to the certificate, even only its dates,
changes the hash. A Let’s Encrypt Community post on DANE TLSA records
explains this for automatically renewed certificates: avoid 3 0 1 and 3 0 2, and publish 3 1 1 with a key that
stays the same across renewals, or 2 1 1 for the issuing CA. With Certbot, the
Certbot user guide documents --reuse-key to keep the
same private key when renewing, and says that not reusing the key is Certbot’s default.
When you do change the key, update DNS first. RFC 7671 section 8.1 describes the order:
- Publish a TLSA record for the new key next to the existing one.
- Wait at least two TTLs so resolvers drop the old record set.
- Switch the server to the new key and certificate, and check that it works.
- Remove the record for the old key.
You can paste a BEGIN PUBLIC KEY block into this tool with selector 1 to get the new record before the new
certificate exists.
How do DNS panels want the record split?
Most hosting panels ask for a name and a value rather than a zone-file line. Cloudflare’s DNS record types reference lists TLSA among the certificate-related record types it supports. The tool shows:
- Zone-file line — the full record, for a BIND-style zone file.
- Name / Host — the owner name relative to the zone you enter (for example
_25._tcp.mail), or the full name with a trailing dot if you leave the zone empty or it does not match. - Value — usage, selector, matching type and the hex data. If your panel has separate boxes, split it at the spaces.
Publish the record at the host name the clients connect to. For mail, that is the MX host name, not the domain in the email address.
How to read the results
- Errors (red, no output) — no host name, an IP address instead of a name, a port outside 1 to 65535, a missing or cut-off PEM block, base64 that does not decode, or bytes that are not an X.509 certificate.
- Private key warning — anything that looks like a private key, such as a BEGIN … PRIVATE KEY block or a PuTTY key file, is refused as a whole and none of it is shown back.
- Warnings (amber) — usage 0 or 1 on port 25, the reminders for usage 2, selector 0 with usage 3, matching
type 0, or extra certificates in the paste. Only the first certificate is used; in a
fullchain.pemthat is the server certificate.
Limits
- This tool only builds text. It never queries DNS and never publishes anything, so it cannot tell you whether the record exists, whether the zone is signed, or whether it matches what the server presents today. AdminKit’s DNSSEC check shows whether a zone is signed and validates, which is the first condition for DANE.
- It reads PEM text only. Convert a DER file with
openssl x509 -inform DERfirst, and open the file to paste its contents. - DANE for mail sits next to MTA-STS, which reaches a similar goal with a policy file served over HTTPS instead of DNSSEC; the MTA-STS policy generator builds that file, and the guide on whether your mail server enforces STARTTLS compares the two.
This tool is part of AdminKit’s email authentication cluster.
Frequently asked questions
Does this tool send my certificate to AdminKit or anywhere else?
No. The certificate, host and port are read by your browser and the hash is computed there with plain JavaScript; nothing you paste is sent to AdminKit or any other server, and the tool does no DNS lookup. A certificate is public anyway, since the server hands it to every client, but the tool still keeps it on your device.
Why is 3 1 1 the default, and when would I use 2 1 1 instead?
3 1 1 (DANE-EE, SubjectPublicKeyInfo, SHA-256) pins the server's own public key, so it keeps matching when the certificate is renewed with the same key. RFC 7672 recommends it for SMTP. 2 1 1 pins the public key of the CA that issued your certificate instead: you paste that CA certificate, the server must send it in its chain, and the record survives renewals with new keys as long as the same CA key signs them. RFC 7671 says DANE-TA records should use selector 0 (2 0 1), so 2 1 1 is a deliberate trade-off, not the default.
Why not use certificate usage 0 or 1 for a mail server?
RFC 7672 says TLSA records for port 25 SMTP SHOULD NOT use usage 0 (PKIX-TA) or 1 (PKIX-EE). Those usages also require the certificate to validate against a public CA the client trusts, and sending mail servers have no agreed list of trusted CAs, so the records add failure modes without adding security. The tool shows a warning if you pick them with port 25.
Does the TLSA record work without DNSSEC?
No. Clients only use TLSA records they can validate with DNSSEC. In an unsigned zone, a sending mail server treats the domain as having no usable TLSA records and falls back to ordinary opportunistic TLS, so the record has no effect. Sign the zone first, then publish the record.
What do I have to do before the server's key changes?
Publish a second TLSA record for the new key next to the old one, wait at least two TTLs so caches pick it up (RFC 7671 section 8.1), then switch the server to the new key and remove the old record. If the key changes first, sending servers that validate DANE reject the new certificate and defer delivery until the record is fixed.
What happens if I paste a private key by mistake?
The tool refuses the whole input, shows a warning, and does not display any of what you pasted. Paste only the BEGIN CERTIFICATE block. If you pasted the private key anywhere else, such as a chat or a ticket, treat it as exposed and replace the key and certificate.