DNSSEC (Domain Name System Security Extensions) is a suite of specifications that add a layer of security to the DNS system, helping to prevent DNS spoofing and other attacks. NSD (Name Server Daemon) is a popular, open-source DNS server implementation that supports DNSSEC.
Prerequisites:
- A running NSD instance.
- A DNS zone file for the domain you want to enable DNSSEC for.
- A key pair (private and public keys) generated using a tool like dnssec-keygen.
Steps to Configure DNSSEC with NSD:
- Create a DNSSEC zone:
Add the following lines to your DNS zone file:
key example.com. DS 256 3 5 12345678901234567890123456789012345678901234567890
key example.com. KSK 256 3 5 12345678901234567890123456789012345678901234567890
• Replace the placeholder key values with the actual values from your key pair.
Add the following line to the zone’s control section:
controls {
allow-update { key example.com.; };
};
- Create a zone file for the keys:
Create a new zone file for the keys (e.g., keys.example.com).
Add the following lines:
key example.com. 256 3 5 12345678901234567890123456789012345678901234567890 13
key example.com. 256 3 5 12345678901234567890123456789012345678901234567890 13
• Replace the placeholder key values with the actual values from your key pair.
- Configure NSD to use the keys:
- In your NSD configuration file, add the following lines:
- zone “example.com” {
- type master;
- file “/etc/bind/example.com”;
- allow-update { key example.com.; };
- dnssec-validation yes;
- key-directory “/etc/bind/keys”;
- };
• Replace the paths with the actual paths to your zone files and key directory.
- Generate the DS record:
Use the dnssec-signzone tool to generate the DS record for your zone:
dnssec-signzone -e example.com. -k keys.example.com. -o example.com.db
• Add the generated DS record to your main zone file.
- Restart NSD:
• Restart the NSD service to apply the changes. - Verify DNSSEC:
Use a DNS lookup tool like dig to verify that the DNSSEC signatures are being generated and validated correctly.
Note: This is a basic example. For more complex setups, you may need to configure additional settings, such as key rollovers and delegation. It’s recommended to consult the NSD documentation for more detailed information.