DNSSEC (DNS Security Extensions) is a set of security extensions for the Domain Name System (DNS) that provides authentication and integrity to DNS responses.

What is DNSSEC?

DNSSEC is a technology that protects DNS against spoofing and manipulation attacks through cryptographic digital signatures in DNS records.

Problems it Solves

DNS Attacks

  • DNS Spoofing: DNS spoofing
  • DNS Cache Poisoning: Cache poisoning
  • Man-in-the-Middle: Man-in-the-middle attacks
  • Pharming: Malicious redirection

Vulnerabilities

  • Lack of Authentication: Lack of authentication
  • Data Integrity: Lack of integrity
  • Trust Issues: Trust issues
  • Security Gaps: Security gaps

DNSSEC Components

Resource Records

  • RRSIG: Resource record signature
  • DNSKEY: DNS public key
  • DS: Delegation signer
  • NSEC/NSEC3: Proof of non-existence
  • NSEC3PARAM: NSEC3 parameters

Cryptographic Algorithms

  • RSA: Public key algorithm
  • ECDSA: Elliptic curve digital signature
  • EdDSA: Edwards digital signature
  • DSA: Digital signature algorithm

Operation

Signing Process

  1. Generate keys: Create ZSK and KSK key pair
  2. Sign records: Sign DNS records with ZSK
  3. Sign ZSK: Sign ZSK with KSK
  4. Publish: Publish signed records

Verification Process

  1. Resolve query: Client queries DNS
  2. Get records: Server returns signed records
  3. Verify signature: Client verifies signature
  4. Validate: Validate authenticity and integrity

Implementation

BIND Configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Configuration /etc/bind/named.conf.options
options {
    directory "/var/cache/bind";
    
    # Enable DNSSEC
    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;
    
    # Key files
    key-directory "/etc/bind/keys";
    
    # Signing policies
    auto-dnssec maintain;
    inline-signing yes;
};

# Zone configuration
zone "example.com" {
    type master;
    file "/etc/bind/db.example.com";
    
    # Enable DNSSEC
    auto-dnssec maintain;
    inline-signing yes;
    
    # Signing keys
    key-directory "/etc/bind/keys";
};

Key Generation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Generate zone signing key (ZSK)
dnssec-keygen -a RSASHA256 -b 2048 -n ZONE example.com

# Generate key signing key (KSK)
dnssec-keygen -a RSASHA256 -b 2048 -n ZONE -f KSK example.com

# Sign zone
dnssec-signzone -S -o example.com db.example.com

# Verify signature
dnssec-verify -o example.com db.example.com.signed

Unbound Configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Configuration /etc/unbound/unbound.conf
server:
    # Enable DNSSEC
    module-config: "validator iterator"
    
    # DNSSEC validation
    trust-anchor-file: "/etc/unbound/root.key"
    
    # Validation configuration
    val-clean-additional: yes
    val-permissive-mode: no
    
    # Logging
    log-queries: yes
    log-replies: yes
    log-servfail: yes

Supported Algorithms

RSA

  • RSA-MD5: Obsolete, not recommended
  • RSA-SHA1: Obsolete, not recommended
  • RSA-SHA256: Recommended
  • RSA-SHA512: For long keys

ECDSA

  • ECDSAP256SHA256: P-256 curve
  • ECDSAP384SHA384: P-384 curve
  • Security: Equivalent to RSA-3072
  • Performance: More efficient than RSA

EdDSA

  • Ed25519: Edwards signature
  • Ed448: Edwards signature
  • Security: Very high
  • Performance: Very efficient

Management Tools

BIND

1
2
3
4
5
6
7
8
9
# Verify DNSSEC status
dnssec-verify -o example.com db.example.com.signed

# Verify keys
dnssec-keygen -T example.com

# Rotate keys
dnssec-keygen -a RSASHA256 -b 2048 -n ZONE example.com
dnssec-signzone -S -o example.com db.example.com

OpenDNSSEC

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# OpenDNSSEC configuration
# /etc/opendnssec/conf.xml
<OpenDNSSEC>
    <Common>
        <Datastore>sqlite3:///var/lib/opendnssec/database.sqlite</Datastore>
        <LogLevel>INFO</LogLevel>
    </Common>
    
    <ZoneList>
        <Zone>
            <Name>example.com</Name>
            <Policy>default</Policy>
            <Input>file:///etc/bind/db.example.com</Input>
            <Output>file:///etc/bind/db.example.com.signed</Output>
        </Zone>
    </ZoneList>
</OpenDNSSEC>

Verification Tools

1
2
3
4
5
6
7
8
9
# Verify DNSSEC
dig +dnssec example.com
dig +sigchase example.com

# Verify trust chain
dig +sigchase +trusted-key=/etc/bind/root.key example.com

# Verify delegation
dig +sigchase +trusted-key=/etc/bind/root.key example.com DS

Applications

Web Security

  • HTTPS: Certificate validation
  • HSTS: HTTP Strict Transport Security
  • Certificate Pinning: Certificate pinning
  • DANE: DNS-based Authentication

Email Security

  • SPF: Sender Policy Framework
  • DKIM: DomainKeys Identified Mail
  • DMARC: Domain-based Message Authentication
  • MTA-STS: SMTP MTA Strict Transport Security

Communications

  • VoIP: Voice over IP
  • SIP: Session Initiation Protocol
  • XMPP: Extensible Messaging and Presence Protocol
  • Matrix: Messaging protocol

Advantages and Disadvantages

Advantages

  • Authentication: Response authentication
  • Integrity: Data integrity
  • Standard: Widely adopted standard
  • Transparent: Transparent to users

Disadvantages

  • Complexity: Implementation complexity
  • Performance: Performance overhead
  • Key Management: Complex key management
  • Adoption: Limited adoption

Best Practices

Configuration

  • Strong Algorithms: Use strong algorithms
  • Key Rotation: Regular key rotation
  • Monitoring: Continuous monitoring
  • Backup: Key backups

Security

  • Key Security: Protect private keys
  • Access Control: Access control
  • Audit Logging: Audit logging
  • Incident Response: Incident response

Performance

  • Caching: Configure appropriate cache
  • Load Balancing: Load balancing
  • Monitoring: Performance monitoring
  • Optimization: Query optimization

Monitoring and Troubleshooting

Monitoring Tools

1
2
3
4
5
6
7
8
9
# Verify DNSSEC status
dig +dnssec example.com
dig +sigchase example.com

# Verify keys
dnssec-keygen -T example.com

# Verify delegation
dig +sigchase +trusted-key=/etc/bind/root.key example.com DS

Common Problems

  • Key Rollover: Key rotation problems
  • Delegation: Delegation problems
  • Validation: Validation problems
  • Performance: Performance problems

Logs and Debugging

1
2
3
4
5
6
7
8
9
# View BIND logs
tail -f /var/log/bind/bind.log

# View Unbound logs
tail -f /var/log/unbound/unbound.log

# Debug DNSSEC
dig +dnssec +cd example.com
dig +sigchase +trusted-key=/etc/bind/root.key example.com

References