Network/Services/DNS: Difference between revisions

From NURDspace
(Created page with "= Summary = We offer both internal and external DNS zones. The internal zones are mostly free-to-use, but the external dns zones are managed via the bofh team. = Available zones = == Internal == * vm.nurd.space * lan.nurd.space * dhcp.nurd.space == External == * nurdspace.nl * nurd.space = Architecture = == Internal DNS == * Internal zones are managed using IPAM and are served using powerdns * On nurdservices, a bind instance transfers zones from ipam == External DNS...")
 
No edit summary
Line 27: Line 27:
== external zones ==
== external zones ==
Edit /etc/nsd/zones/db.<yourdomain>, and dont forget to update the serial. Next, run nsd-control reload. The secondaries will receive a notification and pull the updated zones.
Edit /etc/nsd/zones/db.<yourdomain>, and dont forget to update the serial. Next, run nsd-control reload. The secondaries will receive a notification and pull the updated zones.
= DNSSEC =
== Setup DNSSEC for a domain ==
Start off by generating a zone signing key (ZSK) and a key signing key (KSK).
cd /etc/nsd/zones
ldns-keygen -a ECDSAP256SHA256 -b 1024 nurd.space > nurd.space.zsk
ldns-keygen -k -a ECDSAP256SHA256 -b 2048 nurd.space > nurd.space.ksk
Next, delete the automatically generated DS records, and sign the zone using the newly generated ZSK and KSK.
rm *.ds
ldns-signzone -n -s $(head -n 1000 /dev/random | sha256sum | cut -b 1-16) db.nurd.space `cat nurd.space.zsk` `cat nurd.space.ksk`
Finally, switch the zone config definition to the signed variant of the zonefile. Add .signed to the zone filename, as shown below:
zone:
  name: "nurd.space"
  zonefile: db.nurd.space.signed
Reload the zonefile using nsd-control:
nsd-control reconfig
nsd-control reload nurd.space
Once this is done, dnssec is enabled for the domain. Validate that this is working by checking the DNSKEY record(s) for the domain. You should get two records. One for the KSK, and one for the ZSK.
root@extdns:~# dig DNSKEY @10.208.1.33 nurd.space +multiline +norec +short
256 3 13 DsflOcaa2FufX6cYmH4A+LupEZqQwPGqAE/XTjghg9Kj+SgitAtizv8L rbE2KCJ/VhRZ7SEtptTjdrN9MwCrbg==
257 3 13 j6WGne+l0zp9QiX1lbeGRvYyAm3riQm49hbXeos2uJPh5xS2maAtBryk jfhIHUEYu3fHC1nIi/D2gutun711DQ==
To attach these keys to the DNSSEC chain of trust, you need to generate DS records for the domain, and submit these records to the DNS registrar. This will lead to the DS records being signed with the TLD keys, completing the chain of trust:
cd /etc/nsd/zones
ldns-key2ds -n -f -2 db.nurd.space.signed
This should return two DS records as can be seen below. Submit these records to the DNS registrar to get them included in the TLD zone.
nurd.space. 3600 IN DS 12278 13 2 a9f5b7e06f85aea2679bc242a69950ec5fc8fd21f18833126b088b82c9cef2f6
nurd.space. 3600 IN DS 35766 13 2 ce0766ad4857197d67e631c815ef13c654b6f601f15cbb54c6c43629127794a0
Once this process is completed, the zone is fully signed.

Revision as of 22:07, 4 August 2023

Summary

We offer both internal and external DNS zones. The internal zones are mostly free-to-use, but the external dns zones are managed via the bofh team.

Available zones

Internal

  • vm.nurd.space
  • lan.nurd.space
  • dhcp.nurd.space

External

  • nurdspace.nl
  • nurd.space

Architecture

Internal DNS

  • Internal zones are managed using IPAM and are served using powerdns
  • On nurdservices, a bind instance transfers zones from ipam

External DNS

  • Zones are managed and hosted using NSD on extdns.vm.nurd.space
  • Two externally hosted nameservers are configured as secondaries

Management

internal zones

Go to https://ipam.vm.nurd.space/ and manage your dns entries. Wait for the zonetransfer to complete before trying this

external zones

Edit /etc/nsd/zones/db.<yourdomain>, and dont forget to update the serial. Next, run nsd-control reload. The secondaries will receive a notification and pull the updated zones.

DNSSEC

Setup DNSSEC for a domain

Start off by generating a zone signing key (ZSK) and a key signing key (KSK).

cd /etc/nsd/zones
ldns-keygen -a ECDSAP256SHA256 -b 1024 nurd.space > nurd.space.zsk
ldns-keygen -k -a ECDSAP256SHA256 -b 2048 nurd.space > nurd.space.ksk

Next, delete the automatically generated DS records, and sign the zone using the newly generated ZSK and KSK.

rm *.ds
ldns-signzone -n -s $(head -n 1000 /dev/random | sha256sum | cut -b 1-16) db.nurd.space `cat nurd.space.zsk` `cat nurd.space.ksk`

Finally, switch the zone config definition to the signed variant of the zonefile. Add .signed to the zone filename, as shown below:

zone:
  name: "nurd.space"
  zonefile: db.nurd.space.signed

Reload the zonefile using nsd-control:

nsd-control reconfig
nsd-control reload nurd.space

Once this is done, dnssec is enabled for the domain. Validate that this is working by checking the DNSKEY record(s) for the domain. You should get two records. One for the KSK, and one for the ZSK.

root@extdns:~# dig DNSKEY @10.208.1.33 nurd.space +multiline +norec +short
256 3 13 DsflOcaa2FufX6cYmH4A+LupEZqQwPGqAE/XTjghg9Kj+SgitAtizv8L rbE2KCJ/VhRZ7SEtptTjdrN9MwCrbg==
257 3 13 j6WGne+l0zp9QiX1lbeGRvYyAm3riQm49hbXeos2uJPh5xS2maAtBryk jfhIHUEYu3fHC1nIi/D2gutun711DQ==

To attach these keys to the DNSSEC chain of trust, you need to generate DS records for the domain, and submit these records to the DNS registrar. This will lead to the DS records being signed with the TLD keys, completing the chain of trust:

cd /etc/nsd/zones
ldns-key2ds -n -f -2 db.nurd.space.signed

This should return two DS records as can be seen below. Submit these records to the DNS registrar to get them included in the TLD zone.

nurd.space.	3600	IN	DS	12278 13 2 a9f5b7e06f85aea2679bc242a69950ec5fc8fd21f18833126b088b82c9cef2f6
nurd.space.	3600	IN	DS	35766 13 2 ce0766ad4857197d67e631c815ef13c654b6f601f15cbb54c6c43629127794a0

Once this process is completed, the zone is fully signed.