As of July 2020, the recommended algorithms are RSASHA256 (type 008) and ECDSAP256SHA256 (type 013).
set z=example.com cd /usr/local/etc/namedb/keys dnssec-keygen -a ECDSAP256SHA256 -b 2048 -3 ${z} dnssec-keygen -a ECDSAP256SHA256 -b 2048 -3 -fk ${z} chmod -w,g+r K${z}.+013+* chown bind:bind K${z}.+013+* rndc loadkeys ${z}
After creating the keys we adjust their permissions and ownership and ask named to load them.
Add the following lines to the zone definition in named.conf:
After making the changes update named:auto-dnssec maintain; dnssec-secure-to-insecure yes;
Now sign the zone; NSEC3 is recommended as NSEC allows clients to walk the zone and build a list of all of its DNS records. Use openssl to generate a random hex number to use as the salt value in the hash calculation:rndc reconfig
Look for DNSKEY records:rndc signing -nsec3param 1 0 10 `openssl rand -hex 4` ${z}
The existence of DNSKEY records provide verification that the zone has been signed. However resolvers will not perform DNSSEC validation until you upload the corresponding DS record to the registrar and it appears in the parent domain in the root nameservers.dig dnskey ${z}
Calculate the DS parameters:
Once the new DS record is visible the best way to verify correct operation is with DNSViz, a fantastic tool developed by Casey Deccio. Another good tool is Verisign Labs DNSSEC Analyzer.dig dnskey ${z} | dnssec-dsfromkey -f - ${z} example.com. IN DS 12345 13 2 SOMEBIGLONGHASHYOUWILLPASTEIN
Starting with a zone signed by one (or more) algorithms, here's how to upgrade to a different algorithm.
Upgrade to use ECDSAP256SHA256 (type 013):
Make sure you see a pair of DNSKEY records, one ZSK and one KSK.set z=example.com cd /usr/local/etc/namedb/keys dnssec-keygen -a ECDSAP256SHA256 -b 2048 -3 ${z} dnssec-keygen -a ECDSAP256SHA256 -b 2048 -3 -fk ${z} chmod -w,g+r K${z}.+013+* chown bind:bind K${z}.+013+* rndc loadkeys ${z} dig dnskey ${z}.
Now wait one TTL for propagation; use the TTL from the DS record in the parent zone:
dig +trace ds ${z}.
After waiting the appropriate amount of time generate the DS key and upload to registrar:
dig dnskey ${z} | dnssec-dsfromkey -f - ${z}
Remove the DS key(s) from the parent by logging into the registrar.
Remove ZSK and KSK keys from signing; RSASHA1 (type 007) is used in this example:
-D sets when the DNSKEY record is removed from the zone. -I sets when the DNSKEY record becomes inactive.dnssec-settime -D now -I now keys/K${z}.+007+12345 dnssec-settime -D now -I now keys/K${z}.+007+23456
It's now ok to remove the obsolete keys from named's keys directory and run a final loadkeys:
You should only see DNSKEY records for the new algorithm. And it's always a good idea to run DNSViz.rndc loadkeys ${z} dig dnskey ${z}.