#!/usr/local/bin/bashIP_HOSTNAMES=$(awk '/lease / {ip=$2} /client-hostname/ {print ip, $2}' /var/dhcpd/var/db/dhcpd.leases | tr -d '";')COUNT=0while IFS= read -r line; do HOST=$(echo $line | cut -f2 -d' ') grep $HOST /var/unbound/dhcpleases.conf >/dev/null || { echo "$HOST is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.conf" } COUNT=$(($COUNT+1))done <<< "$IP_HOSTNAMES"echo "---"echo "$COUNT total records in dhcpd//dhcpd.leases"
./unbound_dhcp_check.shRS is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.confLGwebOSTV is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.confPX-i7 is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.confLGwebOSTV is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.conf---24 total records in dhcpd//dhcpd.leases
4. The client may choose to relinquish its lease on a network address by sending a DHCPRELEASE message to the server. The client identifies the lease to be released with its 'client identifier', or 'chaddr' and network address in the DHCPRELEASE message. Note that in this case, where the client retains its network address locally, the client will not normally relinquish its lease during a graceful shutdown. Only in the case where the client explicitly needs to relinquish its lease, e.g., the client is about to be moved to a different subnet, will the client send a DHCPRELEASE message.
It seems non-sensical to me to give every single client a static lease. I have never had to do this with any other dhcp server whether win or *nix.
Yeah, neither do we. We do it for clients that are supposed to be in DNS permanently and not change their IPs - which certainly is not every single piece of random equipment out there sending out its hostname that's supposed to be trusted by DNS. The whole "feature" is a hack, not something integrated in Unbound and ISC DHCP (unlike Windows AD, now that you've mentioned it)Related: this "feature" is currently missing altogether in Kea DHCP... https://github.com/opnsense/core/issues/7475