Skip to content

DANE (DNS-based Authentication of Named Entities)

DANE uses DNSSEC to provide certificate authentication for email transport security, enabling encrypted and authenticated connections between mail servers.

How DANE Works

The Problem

Traditional TLS for email (STARTTLS) has vulnerabilities:

  1. Opportunistic encryption: Falls back to unencrypted if TLS fails
  2. No certificate verification: Accepts any certificate by default
  3. Vulnerable to MITM: Attackers can downgrade or intercept connections

The Solution

DANE addresses these issues by:

  1. Publishing certificates in DNS: TLSA records specify expected certificates
  2. Using DNSSEC: Cryptographically signs DNS records
  3. Enabling verification: Receiving servers can verify sender certificates
Sender MTA                                  Receiver MTA
    │                                           │
    │  1. Query MX record                       │
    ├──────────────────────────────────────────►│
    │                                           │
    │  2. Query TLSA record (with DNSSEC)       │
    ├──────────────────────────────────────────►│
    │                                           │
    │  3. Connect with TLS                      │
    ├──────────────────────────────────────────►│
    │                                           │
    │  4. Verify certificate matches TLSA       │
    │                                           │

TLSA Record Format

TLSA records are published at:

_port._protocol.hostname

For SMTP (port 25):

_25._tcp.mail.example.com

Record Structure

_25._tcp.mail.example.com. IN TLSA 3 1 1 <certificate-hash>
FieldPositionDescription
Usage1stHow to use the certificate data
Selector2ndWhich part of certificate to match
Matching Type3rdHow to match (exact or hash)
Certificate Data4thThe actual certificate data or hash

Usage Values

ValueNameDescription
0PKIX-TACA constraint (must chain to this CA)
1PKIX-EECertificate constraint (must be this cert)
2DANE-TATrust anchor (domain-issued CA)
3DANE-EEDomain-issued end entity (recommended)

TIP

For email, 3 (DANE-EE) is recommended. It pins the exact certificate without requiring traditional CA validation.

Selector Values

ValueNameDescription
0FullMatch entire certificate
1SPKIMatch public key only (recommended)

TIP

1 (SPKI) is recommended because it survives certificate renewal if the same key is reused.

Matching Type Values

ValueNameDescription
0FullExact match (no hashing)
1SHA-256SHA-256 hash (recommended)
2SHA-512SHA-512 hash

Example TLSA Records

Recommended configuration (3 1 1):

_25._tcp.mail.example.com. IN TLSA 3 1 1 a]b2c3d4e5f6...

Full certificate pin (3 0 1):

_25._tcp.mail.example.com. IN TLSA 3 0 1 1a2b3c4d5e6f...

When DANE Adds Value

Good Use Cases

Use DANE when:

  • You control your mail server infrastructure
  • DNSSEC is already deployed for your domain
  • You need cryptographic assurance of TLS connection authenticity
  • Your receiving partners support DANE verification
  • High-security environments requiring defense in depth

Limited Value

⚠️ DANE has limited value when:

  • Using hosted email (Google Workspace, Microsoft 365)
  • DNSSEC is not deployed
  • Most email partners don't verify DANE
  • MTA-STS already covers your requirements

DANE vs. MTA-STS

FeatureDANEMTA-STS
Requires DNSSECYesNo
Certificate pinningYesNo (uses CA trust)
Adoption by sendersLowerHigher
Setup complexityHigherLower
Hosted email supportLimitedGood

Recommendation: Most organizations should implement MTA-STS first. Add DANE if you have DNSSEC and need additional assurance.

DANE and MTA-STS Interaction

DANE and MTA-STS can work together:

  1. Both present: Sender should prefer DANE if it validates
  2. Only MTA-STS: Use MTA-STS policy
  3. Only DANE: Use DANE verification
  4. Neither: Opportunistic TLS only

Most major email providers check both when available.

Implementation Steps

Prerequisites

Before implementing DANE:

  • [ ] DNSSEC must be deployed and validated for your domain
  • [ ] You control your mail server's TLS certificates
  • [ ] You have a process for updating TLSA records during certificate rotation

Step 1: Verify DNSSEC

Check if DNSSEC is active:

bash
dig +dnssec example.com

Look for the ad (authenticated data) flag in the response.

Step 2: Generate TLSA Record

Extract the certificate hash:

bash
# For the public key (selector 1) with SHA-256 (matching type 1)
openssl x509 -in cert.pem -noout -pubkey | \
  openssl pkey -pubin -outform DER | \
  openssl dgst -sha256 -binary | \
  xxd -p -c 256

Or use an online TLSA generator with your certificate.

Step 3: Publish TLSA Record

Add the record to your DNS:

_25._tcp.mail.example.com. 3600 IN TLSA 3 1 1 <hash-from-step-2>

Step 4: Test Configuration

Using dig:

bash
dig TLSA _25._tcp.mail.example.com +dnssec

Using online validators:

Step 5: Monitor

  • Monitor for DNSSEC validation issues
  • Set reminders for certificate renewal
  • Update TLSA records before certificates expire

Certificate Rotation

WARNING

DANE requires careful certificate rotation planning. Publishing new TLSA records before certificate rollover is critical.

Rotation Process

  1. Generate new certificate (with same or new key)
  2. Calculate new TLSA hash
  3. Publish both old and new TLSA records:
_25._tcp.mail.example.com. IN TLSA 3 1 1 <old-hash>
_25._tcp.mail.example.com. IN TLSA 3 1 1 <new-hash>
  1. Wait for DNS propagation (at least 2x TTL)
  2. Deploy new certificate
  3. Remove old TLSA record (after old cert expires)

Automation

Consider automating TLSA updates with certificate management tools:

  • Let's Encrypt with DANE plugins
  • Certificate management systems with DNS API integration

Testing and Validation

Manual Testing

Check TLSA record:

bash
dig TLSA _25._tcp.mail.example.com +short

Test with OpenSSL:

bash
openssl s_client -connect mail.example.com:25 -starttls smtp

Online Validators

  • Hardenize: Comprehensive email security test including DANE
  • Internet.nl: Dutch internet standards test
  • DANE SMTP Validator: Specialized DANE testing

Common Validation Errors

ErrorCauseSolution
No TLSA record foundRecord not published or wrong nameVerify record exists at correct location
DNSSEC validation failedDNSSEC not configured or brokenFix DNSSEC chain
Certificate mismatchHash doesn't match current certUpdate TLSA record with current hash
Usage/selector mismatchWrong TLSA parametersVerify parameters match your setup

DANE for Hosted Email

Google Workspace

Google publishes DANE records for their mail servers. As a Google Workspace user:

  • You benefit from DANE when sending to DANE-enabled receivers
  • You cannot publish TLSA records for Google's MX servers

Microsoft 365

Microsoft supports DANE verification when sending. For receiving:

  • DANE support for Microsoft 365 custom domains is limited
  • Check Microsoft documentation for current status

Other Providers

Check with your email provider for:

  • DANE sending verification support
  • DANE receiving (TLSA publishing) options

Best Practices

Do

✅ Deploy DNSSEC before DANE
✅ Use parameters 3 1 1 (DANE-EE, SPKI, SHA-256)
✅ Plan certificate rotation carefully
✅ Monitor DNSSEC validation status
✅ Test after any DNS or certificate changes

Don't

❌ Deploy DANE without DNSSEC
❌ Forget to update TLSA records before certificate rollover
❌ Use short TTLs that cause validation issues
❌ Ignore DANE validation failures in monitoring

MailShield and DANE

MailShield monitors your DANE configuration:

  1. TLSA record detection: Identifies published TLSA records
  2. Validation checks: Verifies DNSSEC and certificate matching
  3. Expiry monitoring: Alerts on upcoming certificate expirations
  4. Security scoring: DANE configuration contributes to your security score
  • MTA-STS - Alternative/complementary transport security
  • TLS-RPT - Reporting for TLS failures
  • DNSSEC - Required prerequisite for DANE

Monitor and secure your email domains.