Skip to main content
DNZ gives the machines your DHCP servers hand addresses to a name, and shows the address space they live in: the subnets, what uses each address, what is free, and what doesn’t add up. Names follow DHCP two ways, and you can use either or both:
  • DNS updates from the DHCP server (RFC 2136): Kea’s DHCP-DDNS and ISC dhcpd sign them with an update key; Windows DHCP sends them unsigned. The name changes the moment a lease does, and DNZ holds these updates to the DHCID rules of RFC 4701/4703.
  • DNZ reads the leases: Kea through its control agent’s API, ISC dhcpd and Windows DHCP from a lease file that is pushed to DNZ, uploaded, or fetched from a URL. A, AAAA and PTR records then follow the leases, and leases that end lose their records.
Records a lease or a DHCP update made are marked DHCP-managed: a DHCP badge in the record list, with the lease’s MAC and end. Records you made are never changed: a name that has records of its own is left alone, and a DHCP-managed record you edit by hand becomes yours. Everything lives in a division, under DNS → DHCP & IPAM.

Which names leases get

A live lease (active, not run out) with a hostname gets:
  • an A record (IPv4) or AAAA record (IPv6) in the division’s zone the name falls in. A hostname with a domain in one of the zones (pc1.lan.example.com, as Kea and Windows send it) is used as it is; a bare hostname (pc1), or one in a domain DNZ has no zone for (ws01.corp.local), gets its first label in the server’s domain: pc1.lan.example.com.
  • a PTR record in the reverse zone, when the division has one (0.10.in-addr.arpa for 10.0.x.x, an ip6.arpa zone for IPv6). PTRs can be turned off per server.
A lease gets no records, listed on the server’s card with the reason, when its name has records DNZ didn’t make from this server’s leases (static records are a conflict; names Kea’s DHCP-DDNS keeps are skipped), when another client already holds the name (the one that has it keeps it), when the name falls in no zone here, or when the address already has a PTR of its own. When a lease ends, is released, or changes its name or address, its records go. Turning a server’s records off keeps reading its leases for IPAM. Every change is a version in the zone’s history (source DHCP), and reads run on the cluster’s leader.

Connect a DHCP server

DNS → DHCP & IPAM → Add DHCP server, then the Setup guide on its card has every block below filled in for your server, with copy buttons.
DNZ reads Kea through the control agent (kea-ctrl-agent), or from Kea 3.0 the DHCP server’s own HTTP control socket. It asks for config-get (subnets, pools, reservations) and lease4-get-all / lease6-get-all, which need the lease_cmds hook. It never changes Kea’s configuration.In kea-dhcp4.conf (the hook’s path depends on the package):
kea-ctrl-agent.conf, with a password you give DNZ too:
Let only DNZ reach the control agent’s port. Recent Kea versions also want /run/kea at mode 750 or tighter.
DNZ reads it every 60 seconds, and at once on Sync now. Delegated prefixes (IA_PD) are left out; reservations without a lease show in IPAM as reserved.Kea’s DHCP-DDNS (D2) updates DNS the moment a lease changes. Make an update key with A, AAAA, PTR and DHCID for the forward and reverse zones, then in kea-dhcp-ddns.conf (D2 wants DNZ’s DNS address as an IP):
and in kea-dhcp4.conf:
With D2 on, turn the server’s A / AAAA records off in DNZ: D2 keeps the names, and DNZ still reads the leases for IPAM.

The DHCID rules

A DHCID record is a hash of the client’s identity; DHCP servers keep one at every name they register (RFC 4701), so a name stays with the client that has it. Kea checks this itself (check-with-dhcid, RFC 4703): it adds a name only while it is free, changes or removes it only while the DHCID is its client’s, and on release removes the address, then the DHCID. DNZ holds every DNS UPDATE that carries a DHCID, and every unsigned update from a DHCP server, to the same rules on its own side, whatever the client’s conflict resolution mode:
  • a name with static records (A, AAAA, PTR, CNAME or DHCID no DHCP update or lease made) is never changed: the update gets YXDOMAIN;
  • an update with a DHCID never changes a name whose DHCID is another client’s (YXDOMAIN).
So Kea’s no-check-with-dhcid still can’t take another client’s name, or yours. To let clients take names over, use no-check-without-dhcid: Kea then sends ordinary DNS UPDATEs, limited only by the key’s scope.

IPAM

DNS → DHCP & IPAM → IPAM puts together, per division:
  • Subnets: the DHCP servers’ (Kea’s subnets and shared networks, Windows scopes), the division’s client networks, and ones added by hand. The same CIDR from several places is one subnet.
  • Addresses: every lease and reservation, A/AAAA record and PTR, with its hostname, MAC, source and when the client was last seen. An address counts as used while it has a live lease, a reservation, or a record.
  • Use and free ranges: per subnet and pool; an IPv4 network loses its network and broadcast address. Any network can be opened, known or not.
  • Conflicts: two names on one address, a static record on an address leased to another machine, a static record inside a DHCP pool, a PTR to a local name without that address, and leases whose name is taken.
Subnets and DHCP servers also show in the topology map. The counts are on /metrics: dnz_dhcp_leases, dnz_dhcp_records_synced_total, dnz_dhcp_read_success, dnz_ipam_conflicts and more. See also: dnz dhcp and dnz ipam, DHCP and IPAM API.