DNSSEC+Fundamentals
DNSSEC+Fundamentals
OPEN TUTORIAL
12 August 2025
2 v1.0
Overview
• DNSSEC Technical Overview
• DNSSEC Validation
• DNSSEC Zone Signing
3 v1.1
Pre-requisites
• This tutorial assumes that you understand
o DNS operations and delegation
o Cryptography concept and algorithms
4 v1.1
DNSSEC Technical Overview
5 v1.1
Why DNSSEC
• What aspects of DNS do we need security?
- DNS data which can be corrupted
- Transactions between DNS servers and clients
- Privacy of DNS queries/requests
- Validity of DNS data received (not tampered, confirmed source)
6 v1.1
DNS Vulnerabilities
2
3 5
Dynamic
updates Secondary
DNS Resolver/Host
Cache pollution by
Data spoofing
Unauthorized updates
7 v1.1
DNS Cache Poisoning
3
1 www.example.com 192.168.1.99
I want to access www.example.com 2001:DB8::9
www.example.com QID=64569
(pretending to be
QID=64570 the authoritative
zone)
QID=64571 match!
2
QID=64571
Root/GTLD
Client DNS Caching
Server
QID=64571
3
www.example.com 192.168.1.1
www.example.com 2001:DB8::1
ns.example.com
Webserver
(192.168.1.1
2001:DB8::1)
8 v1.1
DNSSEC
Cache impersonation
Zone administrator
Dynamic
updates
Secondary DNS
Resolver/Host
Cache pollution by
Data spoofing
9 v1.1
Crypto & DNSSEC
• Crypto provides confidentiality, integrity, authenticity and non-
repudiation
o For DNSSEC, we need integrity & authenticity
o DNSSEC is not concerned with encrypting DNS data
10 v1.1
What is DNSSEC?
• DNS Security Extensions
• Protects the integrity of data in DNS
• A form of digitally signing the data to attest its validity
• Provides a mechanism to:
o establish authenticity and integrity of data
o delegate trust to third parties or parent zones
11 v1.1
How DNS Works – Resolution
12 v1.1
How DNSSEC Works
13 v1.1
How DNSSEC Works
Authoritative server
- Signs the zones
- Answers queries with the record requested
- Also sends the digital signature corresponding to the record DNS Auth Server
Validating Resolvers
- Authenticates the responses from the server
- Data that is not validated results to a “SERVFAIL” error
DNS Resolver
14 v1.1
How DNSSEC Works
• Records are signed with private key to prove its authenticity and
integrity
• The signatures are published in DNS
• Public key is also published so record signatures can be verified
• Child zones also sign their records with their private key
• Parent signs the hash of child zone public key to prove authenticity
15 v1.1
How DNSSEC Works
• RRsets are signed with private key to prove its authenticity and
integrity
• The signatures are published in DNS as RRSIG
• Public DNSKEY is also published so RRSIG can be verified
• Child zones also sign their records with their private key
• Parent signs the child zone’s DS record to prove authenticity
16 v1.1
New Resource Records
17 v1.1
RRs and RRsets
• Resource Record – each entry in the zonefile
18 v1.1
New Resource Record – RRSIG
• Resource Record Signature
• The private part of the key-pair is used to sign the resource record set
(RRset)
• The digital signature per RRset is saved in an RRSIG record
RR type signed Digital signature algorithm
Number of labels in the
signed name
Signature expiry
Date signed
19 v1.1
New Resource Record – DNSKEY
• Contains the zone’s public key
• Uses public key cryptography to sign and authenticate DNS resource
record sets (RRsets)
20 v1.1
New Resource Record – DS
• Delegation Signer
• Establishes authentication chains between DNS zones
• Must be added in the parent’s zonefile
• In this example, irrashai.net has been delegated from .net. This record
is added in the.net zone file
Key ID
DNSKEY algorithm
Digest type: 1 = SHA1 or 2 = SHA256
21 v1.1
New Resource Record – NSEC
• Next Secure
• Forms a chain of authoritative owner names in the zone
• Also proves the non-existence of a domain
• Each NSEC record also has a corresponding RRSIG
23 v1.1
New Resource Record - NSEC3
• NSEC allows an attacker to walk through the linked list to find all the
records in the zone file. This is called zone walking
• NSEC3 uses a hashing algorithm to list the next available domain in
“hashed” format
• It is still possible for an attacker to do zone walking, although at a
higher computation cost
24 v1.1
DNSSEC Delegation
PARENT ZONE
Parent adds NS record Also adds DS record
of child zone of child zone
25 v1.1
New Resource Records – CDS and CDNSKEY
• Child Delegation Signer
• Child DNS Key
7344
26 v1.1
Chain of Trust
• DNSSEC follows this chain of trust .
DS
• Establishes a chain of trust from parent to child zone
net
o Parent does not sign child zone
o Parent only signs a pointer to the child zone (key) DS
apnic.net
• The root is on top of the chain (also called trust anchor)
DS
abc.apnic.net
27 v1.1
Trust Anchor
• Trust anchor is an authoritative entity for which trust is assumed, not
derived.
7958
28 v1.1
Trust Anchor – Root Zone
<TrustAnchor id="380DC50D-484E-40D0-A3AE-68F2B18F61C7" source="http://data.iana.org/root-
anchors/root-anchors.xml">
<Zone>.</Zone>
<KeyDigest id="Kjqmt7v" validFrom="2010-07-15T00:00:00+00:00" validUntil="2019-01-
11T00:00:00+00:00">
<KeyTag>19036</KeyTag>
<Algorithm>8</Algorithm>
<DigestType>2</DigestType>
<Digest>49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5</Digest>
</KeyDigest>
<KeyDigest id="Klajeyz" validFrom="2017-02-02T00:00:00+00:00">
<KeyTag>20326</KeyTag>
<Algorithm>8</Algorithm>
<DigestType>2</DigestType>
<Digest>E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D</Digest>
</KeyDigest>
</TrustAnchor>
https://data.iana.org/root-anchors/root-anchors.xml
29 v1.1
DNSSEC Keys
• In practice, we use two keypairs
o one to sign the zones, another to sign the other key
o Unless using Combined Signing Key (CSK)
• Using a single key or both keys is an operational choice (RFC allows both
methods)
30 v1.1
Types of Keys
Zone Signing Key (ZSK)
Sign the RRsets within the zone
Signed by the KSK
Uses flag 256
31 v1.1
Signature Expiration
• Keys do not expire
o Still a good practice to generate new ones regularly for added security
32 v1.1
DNSSEC Algorithms
http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
33 v1.1
DNSSEC Algorithms – RFC 8624
http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
34 v1.1
DNSSEC Algorithms – Statistics (as of 25/04/2022)
https://stats.dnssec-tools.org/
35 v1.1
DNSSEC Validation
36 v1.1
How DNSSEC Validation Works (Diagram)
37 v1.1
How DNSSEC Validation Works (Diagram)
38 v1.1
DNSSEC in the Resolver
• Recursive servers that are DNSSEC-enabled (or security-aware) can
validate signed zones
39 v1.1
DNSSEC Validation
;; ANSWER SECTION:
www.apnic.net. 300 IN CNAME www.apnic.net.cdn.cloudflare.net.
www.apnic.net. 300 IN RRSIG CNAME 8 3 300 ( 20190608045355
20190509035355 43023 apnic.net.
oX8qHhFXJLyu3TKru/1sGrDZnnyq3+aI2zhIFk6IF6PK
nTXrzFE/USOjDffJI5+x3QAzPzBKDKXB1+XaXHq1lgw9
Mw6i3mx+NTkjfq7m1bN/wbZD8ddzjY1GK4lrZ/zM39WL
5GQ+2ryIMY0aQFdQzufnHkGHMlqJM6fbHdREwPY= )
40 v1.1
DNSSEC Validation
41 v1.1
DNSSEC Validation
• Other options if you don’t have a validating resolver
o Online web tools
o Browser plugins
42 v1.1
DNSSEC Validation
Without validation With validation
43 v1.1
DNSSEC Validation
44 v1.1
DNSSEC For Network Service Providers
• Enable DNSSEC on your recursive servers and validate responses
o Deploy DNSSEC-validating resolvers
45 v1.1
DNSSEC for End Users
• Use a dnssec-validating resolver
• If not available, use other tools (such as browser plugin)
46 v1.1
DNSSEC Validation
https://stats.labs.apnic.net/dnssec
47 v1.1
DNSSEC Zone Signing
48 v1.1
DNSSEC Deployment Map
https://www.internetsociety.org/deploy360/dnssec/maps/
49 v1.1
DNSSEC Deployment Maps (AP)
https://www.internetsociety.org/deploy360/dnssec/maps/
50 v1.1
DNSSEC for Registries and Hosting Providers
• Sign your zones
51 v1.1
DNSSEC – Deploy a Secure Zone (Manual)
1. Enable DNSSEC in the config file
2. Generate key pairs (KSK and ZSK)
3. Publish your public key
4. Signing the zone
5. Publish the new zonefile
6. Test the server
7. Push the DS record (to parent zone)
52 v1.1
Enable DNSSEC
• Enable DNSSEC in the configuration file (named.conf)
options {
Notes: For BIND9:
directory “….” • Auto – uses trust-anchor for DNS root
dnssec-enable yes; automatically
dnssec-validation yes|no|auto; • Yes – trust anchor explicitly configured
• No – no DNSSEC validation
};
53 v1.1
Generating Keypairs
• Generate ZSK and KSK
Or simply:
Notes: Algorithm and keysize is an
dnssec-keygen –f KSK <myzone> operational choice, but generally:
- ECDSA is recommended
- Keysize must be at least 2048 for KSK
54 v1.1
Generating Keypairs
• To create ZSK
• To create KSK
55 v1.1
Generating Keypairs
• To create ZSK
• To create KSK
56 v1.1
Generating Keypairs - Using NSEC3
• Generate keys
dnssec-keygen -r /dev/urandom -a RSASHA256 -3 -b 1024 -n
ZONE irrashai.net
57 v1.1
Publishing the public key
• A few options to do this:
o Using $INCLUDE you can call the public key (DNSKEY RR) inside the
zone file
$INCLUDE /path/Kmyzone.net.+005+33633.key ; ZSK
$INCLUDE /path/Kmyzone.net.+005+00478.key ; KSK
o You can also manually enter the DNSKEY RR in the zone file
o Or add the files into a key directory
zone { key-directory “/etc/bind/keys”; };
58 v1.1
Signing the zone
Notes: Most of the following steps have
• Sign the zone using the secret keys: been automatically done by the software.
The manual steps are shown to understand
the signing process.
• Once you sign the zone a file with a .signed extension will be created
db.myzone.net.signed
59 v1.1
Signing the zone
• Note that only authoritative records are signed
o NS records for the zone itself are signed
o NS records used for delegations are not signed
o DS records are signed
o Glue records are not signed
60 v1.1
Inline Signing
• Searches the key repository for any keys that will match the zone
being signed
options {
keys-directory { “path/to/keys”;
};
61 v1.1
Inline Signing
• Then use RNDC to load the new keys and do inline signing.
rndc reconfig
rndc loadkeys myzone.net
rndc signing –list myzone.net
From BIND 9.16, dnssec-policy configuration option can be used to specify Key and
Signing Policy. This may soon replace auto-dnssec and inline-signing.
62 v1.1
Using NSEC3
• Load the keys and sign the zone
rndc loadkeys irrashai.net
rndc signing –NSEC3PARAM 1 0 10 <some-salt> irrashai.net.
63 v1.1
Publishing the new Zone File
• Reconfigure to load the signed zone. Edit named.conf and point to the
signed zone.
zone “<myzone>” {
type master;
# file “db.myzone.net”;
file “db.myzone.net.signed”;
};
64 v1.1
Publishing the new Zone File
• Reconfigure to load the signed zone. Edit named.conf and point to the
signed zone.
zone “<myzone>” {
type master;
# file “db.192.168.100”;
file “db.192.168.100.signed”;
};
65 v1.1
Test the server
• Ask a dnssec-enabled server and see whether the answer is signed
66 v1.1
Testing with Dig
dig @localhost www.irrashai.net +dnssec (+multiline)
67 v1.1
Testing with Dig
dig @localhost -x 192.168.100.100 +dnssec
68 v1.1
Pushing the DS Record to the Parent Zone
• The DS record must be published by the parent zone
• Contact the parent zone to communicate the KSK to them
69 v1.1
Pushing the DS Records for Forward Zone
70 v1.1
Pushing the DS Record for Reverse Zone
Using MyAPNIC
71 v1.1
Tools: DNSViz
72 v1.1
Ways to Deploy DNSSEC
• As part of the DNS software used
DNSSEC tools for BIND,
o Manual key management NSD, PowerDNS, etc
o Semi-automatic
DNS Appliance
o Good for dynamic environment
• Using an external appliance 73
o ‘dnssec-in-a-box’
o Fully automates key generation, signing and rollover
73 v1.1
DNSSEC Signer Appliance
74 v1.1
75 v1.1
Thank You!
Thank You!
END OF SESSION
END OF SESSION
76 v1.1