BeryJu/gravity

Remove/update all related DNS records when DHCP lease is updated/removed

tigattack opened this issue · 2 comments

This could be considered an extension of the functionality we spoke about a while ago, implemented in e809e84.

When a DHCP lease is updated or removed, it would be good if the DNS record is also updated or removed accordingly. This seems to work as I'd hope in some cases, but not others.

Does work:

  • Client updates lease, A record is updated
  • Lease expires, A & PTR records also expire (as added in e809e84, tbh I haven't monitored this closely, but I'm pretty sure it works as expected)

Doesn't work:

  • Client updates lease, PTR record is not updated
  • User deletes lease, A and PTR records remain

To me, the lack of PTR updates is the priority. It's easy enough to clean up records after manual removal of a lease.

Since the removal of PTRs seems to rely exclusively on the expiry time, reverse lookup zones end up looking like this:
image

With 5cf6341, (and now cedcbd6), when the hostname of a dhcp lease changes, it will also update the record/create a new one, and the old one will expire
This fixes this for most cases, except for reservations, where as there's no expiry the old records will not be deleted

Ty bb ❤️