Network SecurityUnit 812 min read
DNSSEC: Digital Signatures, Trust Chains, and DNS Authentication
Unit 8 of Network Security: DNSSEC mechanisms, cryptographic algorithms, trust anchors, validation processes, and protection against DNS spoofing and cache poisoning.
Key points
- DNSSEC adds digital signatures to DNS records to ensure data integrity and authenticity.
- It uses a hierarchical chain of trust starting from the root zone key.
- DNSSEC does not provide confidentiality or prevent denial-of-service attacks.
- Validation requires the resolver to verify signatures using public keys from the chain.
- Key rollover is a critical operational challenge to maintain security without service interruption.
1. Introduction to DNS Vulnerabilities
The Domain Name System (DNS) is the phone book of the internet, translating human-readable domain names (e.g., www.nepalbank.com) into IP addresses. However, standard DNS was designed for efficiency, not security. It lacks built-in mechanisms to verify that the data received is genuine.
The Threat: DNS Spoofing and Cache Poisoning
In a standard DNS query, a resolver asks an authoritative server for an IP address. An attacker can intercept this communication or inject fake responses into the DNS cache. This is known as DNS Spoofing or Cache Poisoning.
Scenario:
- A user types
www.esewa.com. - The local DNS resolver asks the authoritative server for the IP.
- An attacker on the same network sends a fake response claiming
www.esewa.comresolves to192.168.1.100(the attacker's IP). - If the resolver accepts this fake response and caches it, the user is redirected to the attacker's site, where they might be asked to enter their eSewa password.
DNSSEC (Domain Name System Security Extensions) solves this by allowing DNS data to be cryptographically signed.
2. Core Concepts of DNSSEC
DNSSEC is not a single protocol but a set of extensions to the DNS protocol. It provides three main services:
- Data Origin Authentication: Verifying that the data came from the claimed source.
- Data Integrity: Ensuring the data has not been altered in transit.
- Authenticity: Confirming the identity of the signer.
It does not provide:
- Confidentiality: DNS queries and responses are still sent in clear text (unless combined with DNS-over-TLS or DNS-over-HTTPS).
- Availability: It does not prevent Denial of Service (DoS) attacks.
Key Components
- Resource Record (RR): The standard DNS data entry (e.g., A record, AAAA record).
- RRSIG (Resource Record Signature): A new record type that contains the digital signature of the original record.
- DNSKEY: A record type that holds the public keys used for signing and verification.
- DS (Delegation Signer): A record in the parent zone that contains the hash of the child zone's public key. This links the child zone to the parent zone.
- NSEC/NSEC3: Records used to prove the non-existence of a domain name (preventing "NXDOMAIN" spoofing).
3. The Chain of Trust
DNSSEC relies on a hierarchical trust model. The trust starts at the root of the DNS hierarchy and flows down to the specific domain.
graph TD
A["Root Zone (.)"] -->|"DS Record"| B["TLD Zone (.com)"]
B -->|"DS Record"| C["Domain Zone (esewa.com)"]
C -->|"RRSIG"| D["Host Record (www.esewa.com)"]- Root Trust Anchor: The root zone is signed with a key that is hardcoded into the DNS resolvers (the "Trust Anchor").
- TLD Signature: The root zone signs the TLD (e.g.,
.com). The.comzone contains aDSrecord that points to the public key of theesewa.comzone. - Domain Signature: The
esewa.comzone signs its own records (likewww) and provides aDSrecord to its parent (.com). - Validation: When a resolver receives a response for
www.esewa.com, it checks the signature using the public key fromesewa.com. It then verifies that theesewa.comkey is trusted by checking theDSrecord in.com, and so on, up to the root.
4. How DNSSEC Works: The Validation Process
When a DNS resolver receives a DNS response with DNSSEC data, it performs the following steps:
sequenceDiagram
participant User
participant Resolver
participant AuthoritativeServer
participant Root
participant TLD
User->>Resolver: Query for www.nepalbank.com
Resolver->>AuthoritativeServer: DNSSEC-enabled query
AuthoritativeServer-->>Resolver: A record + RRSIG + DNSKEY
Resolver->>Resolver: Verify RRSIG using DNSKEY
Resolver->>TLD: Query for DS record of nepalbank.com
TLD-->>Resolver: DS record
Resolver->>Resolver: Verify DS matches DNSKEY hash
Resolver->>Root: Query for DS record of .com
Root-->>Resolver: DS record
Resolver->>Resolver: Verify Root Trust Anchor
Resolver-->>User: Secure response (103.21.244.10)DNSSEC validation sequence for nepalbank.com- Check for RRSIG: Does the response contain an
RRSIGrecord for the requested data? - Retrieve Public Key: The resolver fetches the
DNSKEYrecord for the zone that signed the data. - Verify Signature: The resolver uses the public key to verify the digital signature in the
RRSIGrecord against the original data. - Verify Chain of Trust:
- The resolver checks if the
DNSKEYused is valid. - It looks for a
DSrecord in the parent zone. - It verifies that the hash of the
DNSKEYmatches theDSrecord. - This process repeats up the hierarchy until the Root Trust Anchor is reached.
- The resolver checks if the
- Result:
- Bogus: If any signature fails or the chain is broken, the resolver discards the data and returns an error (SERVFAIL).
- Secure: If all signatures are valid, the data is considered authentic.
- Insecure: If the zone is not signed, the data is treated as insecure (standard DNS behavior).
Visualizing the Packet Structure
A standard DNS response with DNSSEC includes additional records.
5. Cryptographic Algorithms
DNSSEC uses asymmetric cryptography (Public Key Infrastructure). The most common algorithms are:
- RSA/SHA-256: Uses RSA for signing and SHA-256 for hashing. Widely supported.
- ECDSA P-256: Uses Elliptic Curve Digital Signature Algorithm. Smaller keys and faster verification than RSA, increasingly preferred for mobile devices and IoT.
The signature process involves:
- Hashing the DNS record data.
- Encrypting the hash with the zone's Private Key.
- Storing the result in the
RRSIGrecord.
Verification involves:
- Decrypting the
RRSIGusing the zone's Public Key. - Comparing the result with the hash of the received data.
6. Worked Example: Validating www.nepalbank.com
Let's trace the validation process for a user in Nepal accessing www.nepalbank.com.
- Query: User's device asks local resolver: "What is the IP for
www.nepalbank.com?" - Response: The authoritative server for
nepalbank.comsends back:Arecord:103.21.244.10RRSIGrecord: Signature of theArecord.DNSKEYrecord: Public key fornepalbank.com.
- Local Verification:
- Resolver calculates the hash of the
Arecord. - Resolver uses the
DNSKEYto verify theRRSIG. - Check 1: Is the signature valid? Yes.
- Resolver calculates the hash of the
- Chain Verification:
- Resolver needs to trust the
DNSKEYfornepalbank.com. - It queries the
.comTLD server for theDSrecord fornepalbank.com. - The
.comserver returns theDSrecord (a hash of thenepalbank.compublic key). - Resolver compares the hash of the received
DNSKEYwith theDSrecord. - Check 2: Do they match? Yes.
- Resolver needs to trust the
- TLD Verification:
- Resolver needs to trust the
.comserver. - It queries the Root server for the
DSrecord for.com. - Root server returns the
DSrecord for.com. - Resolver verifies the
.comDNSKEYagainst the RootDSrecord. - Check 3: Is the Root signature valid? Yes (using the hardcoded Root Trust Anchor).
- Resolver needs to trust the
- Final Result: The resolver marks the response as Secure and returns
103.21.244.10to the user.
If an attacker had tried to inject a fake IP, the signature would not match the public key, and the resolver would return a SERVFAIL error, blocking the attack.
7. DNS-Based Authentication of Named Entities (DANE)
DNSSEC is often used in conjunction with DANE (DNS-Based Authentication of Named Entities). DANE allows DNS to specify which certificates are valid for a domain.
- Use Case: HTTPS (TLS) connections.
- How it works: A domain owner publishes a
TLSArecord in their DNS zone. This record contains a hash of the server's TLS certificate. - Benefit: When a browser connects to
https://www.nepalbank.com, it can check theTLSArecord to ensure the certificate presented by the server is the one authorized by the domain owner. This prevents Man-in-the-Middle attacks using rogue certificates.
sequenceDiagram
participant Browser
participant Resolver
participant AuthServer
participant BankServer
Browser->>Resolver: DNS Query for www.nepalbank.com (TLSA)
Resolver->>AuthServer: Query for TLSA record
AuthServer-->>Resolver: TLSA Record (Hash of Cert) + RRSIG
Resolver-->>Browser: TLSA Record (Verified)
Browser->>BankServer: TLS Handshake (Connect)
BankServer-->>Browser: Server Certificate
Browser->>Browser: Compare Cert Hash with TLSA Record
alt Match
Browser->>BankServer: Secure Connection Established
else Mismatch
Browser->>Browser: Connection Refused (Security Alert)
end8. Advantages and Disadvantages
| Feature | Standard DNS | DNSSEC |
|---|---|---|
| Integrity | No | Yes (Digital Signatures) |
| Authenticity | No | Yes (Chain of Trust) |
| Confidentiality | No | No (Requires DoT/DoH) |
| Complexity | Low | High (Key Management) |
| Performance | Fast | Slower (Larger Packets, Crypto Ops) |
| Availability | High | Can be lower if keys are mismanaged |
Advantages:
- Prevents DNS spoofing and cache poisoning.
- Provides a foundation for other security protocols like DANE.
- Global standard, widely supported by major ISPs and root servers.
Disadvantages:
- Key Management: Managing private keys is complex. If a private key is compromised, the entire zone is compromised.
- Key Rollover: Keys must be rotated periodically. If done incorrectly, it can cause outages.
- Packet Size: DNSSEC records increase the size of DNS responses, which can cause fragmentation issues with older resolvers.
- No DoS Protection: Attackers can still flood the DNS server with queries.
9. In the real world
- Nepal Telecom (NTC) and Ncell: Major ISPs in Nepal are gradually deploying DNSSEC validation on their recursive resolvers. When you browse the web using NTC's Wi-Fi, their DNS servers verify that the IP addresses for sites like
www.nepalbank.comorwww.esewa.comare authentic. This protects customers from being redirected to phishing sites that mimic local banks. - Global Root Servers: The 13 root name servers (operated by ICANN) are all signed with DNSSEC. This means that every DNS query that starts from a trusted root is protected against tampering at the highest level of the internet hierarchy.
- Email Security (SPF/DKIM/DMARC): While not directly DNSSEC, many email authentication systems rely on DNS records. DNSSEC ensures that these records (like SPF records) cannot be forged, strengthening the overall security of email communication for companies like Daraz or local banks.
10. Exam tip
- Focus on the Chain of Trust: Exams often ask you to explain how a resolver validates a record. Be ready to draw the hierarchy (Root -> TLD -> Domain) and explain the role of
DSandDNSKEYrecords in linking them. - Know the Record Types: Memorize the purpose of
RRSIG,DNSKEY,DS, andNSEC. A common question is "What record proves the non-existence of a domain?" (Answer: NSEC/NSEC3). - Limitations: Always mention that DNSSEC does not provide confidentiality or prevent DoS attacks. This is a common trap in multiple-choice questions.
- DANE: Be prepared to explain how DNSSEC can be used to validate TLS certificates (DANE), as this connects DNS security to web security.
In the real world
- eSewa and Khalti: Use DNSSEC to prevent phishing attacks where attackers spoof eSewa’s or Khalti’s domain (e.g.,
eSewa.com→eSewa.fake.com). Their DNS records are signed to ensure users reach the legitimate payment gateway. - Nepal Rastra Bank (NRB) and NEPSE: Critical financial and stock exchange domains (e.g.,
nepalbank.com,nepse.org.np) deploy DNSSEC to authenticate transactions and prevent DNS-based fraud during online banking or trading. - NTC and Ncell: Telecom providers use DNSSEC to secure their DNS infrastructure, ensuring customers connect to legitimate portals (e.g.,
ntc.net.np,ncell.com.np) instead of attacker-controlled mirrors during login or service access.
Based on the TU BSc CSIT syllabus for Network Security (CSC416), unit 8.
Discussion
Loading…