DNSSEC Part II: the Implementation
This article is the second in a series on DNSSEC. In the first one, I gave a general overview of DNSSEC concepts to lay the foundation for this article, which discusses how to enable DNSSEC for a zone using BIND. If you want to deploy DNSSEC but aren't sure what I mean when I say KSK, ZSK, DLV or DS record, you may want to go back to Part I to refresh yourself on the concepts, because in this article, I'm going to dive right in to implementation.
Adding DNSSEC to a zone using BIND involves a few extra steps on top of what you normally would do to configure BIND as a master for your zone. First, you will need to generate a Key-Signing Key (KSK) and Zone-Signing Key (ZSK), then update the zone's config and sign it with the keys. Finally, you will reconfigure BIND itself to support DNSSEC. After that, your zone should be ready, so if your registrar supports DNSSEC, you can update it or otherwise use DLV with a provider like dlv.isc.org. Now, let's look at the steps in more detail using my greenfly.org zone as an example.
Make the Keys
The first step is to generate the KSK and ZSK for your zone. As I mentioned in my
previous article, the KSK is used only to sign ZSKs in the zone and to provide a
signature for the zone's parent to sign, while ZSKs sign the records in each
zone. Having separate keys also allows you to create a stronger KSK and have a
weaker ZSK that you can rotate out each month. So first, let's create a KSK for
$ cd /etc/bind/ $ dnssec-keygen -a RSASHA1 -b 2048 -n ZONE -f KSK greenfly.org
By default, the
dnssec-keygen command dumps the generated keys in the current
directory, so change to the directory in which you store your BIND
-b arguments set the algorithm (RSASHA1) and key
size (2048 bit), while the
-n option tells
dnssec-keygen what kind of key it is
creating (a ZONE key). You also can use
dnssec-keygen to generate keys for DDNS
and other BIND features, so you need to be sure to specify this is for a zone. I
also added a
-f KSK option that tells
dnssec-keygen to set a bit that denotes
this key as a KSK instead of a ZSK. Finally, I specified the name of the zone this
key is for: greenfly.org. This command should create two files: a .key file, which
is the public key published in the zone, and a .private file, which is the private
key and should be treated like a secret. These files start with a K, then the
name of the zone, and then a series of numbers (the latter of which is
randomly generated), so in my case, it created two files:
Kgreenfly.org.+005+10849.key and Kgreenfly.org.+005+10849.private.
Next I need to create the ZSK. The command is very similar to the command to
create the KSK, except I lower the bit size to 1024 bits, and I remove the
$ dnssec-keygen -a RSASHA1 -b 1024 -n ZONE greenfly.org
This command creates two other key files: Kgreenfly.org.+005+58317.key and Kgreenfly.org.+005+58317.private. Now I'm ready to update and sign my zone.
Update the Zone File
Now that each key is created, I need to update my zone file for greenfly.org (the
file that contains my SOA, NS, A and other records) to include the public KSK and
ZSK. In BIND, you can achieve this by adding
$INCLUDE lines to the end of your
zone. In my case, I added these two lines:
$INCLUDE Kgreenfly.org.+005+10849.key ; KSK $INCLUDE Kgreenfly.org.+005+58317.key ; ZSK
Sign the Zone
Once the keys are included in the zone file, you are ready to sign the zone
itself. You will use the
dnssec-signzone command to do this:
$ dnssec-signzone -o greenfly.org -k Kgreenfly.org.+005+10849 \ db.greenfly.org Kgreenfly.org.+005+58317.key
In this example, the
-o option specifies the zone
origin, essentially the
actual name of the zone to update (in my case, greenfly.org). The
-k option is
used to point to the name of the KSK to use to sign the zone. The last two
arguments are the zone file itself (db.greenfly.org) and the name of the ZSK file
If you are using DLV, you will add an extra
-l option to specify the DLV server
you are using:
$ dnssec-signzone -l dlv.isc.org -o greenfly.org -k \ Kgreenfly.org.+005+10849 db.greenfly.org \ Kgreenfly.org.+005+58317.key
In either case, the command will create a new .signed zone file (in my case,
db.greenfly.org.signed) that contains all of your zone information along with a
lot of new DNSSEC-related records that list signatures for each RRSET in your
zone. If you aren't using DLV, it also will create a dsset-zonename file that
contains a DS record you will use to get your zone signed by the zone parent. If
you are using DLV, you will get a dlvset-zonename file. Any time you make a
change to the zone, simply update your regular zone file like you normally would,
then run the
dnssec-signzone command to create an
updated .signed file. Some
administrators recommend even putting the
dnssec-signzone command in a cron job
to run daily or weekly, as by default the key signatures will expire after a
month if you don't run
dnssec-signzone in that time.
Kyle Rankin is a VP of engineering operations at Final, Inc., the author of a number of books including DevOps Troubleshooting and The Official Ubuntu Server Book, and is a columnist for Linux Journal. Follow him @kylerankin.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Google's Abacus Project: It's All about Trust
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Seeing Red and Getting Sleep
- Back to Backups
- Secure Desktops with Qubes: Introduction
- Fancy Tricks for Changing Numeric Base
- Working with Command Arguments
- Secure Desktops with Qubes: Installation
- Linux Mint 18
- CentOS 6.8 Released
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide