peteeckel/netbox-plugin-dns

RFC2317 CNAMEs pointing to PTR records disappear when one of the A records changes value

Closed this issue · 0 comments

Versions
NetBox Version: 3.7.4
NetBox DNS Version: 0.22.6
Python Version: 3.11.5

Describe the bug
When the value of an A record is changed and the PTR record is in an RFC2317 zone with managed parent zone, the CNAME record in the parent zone is deleted even if it is still pointing to another RFC2317 PTR record.

To Reproduce

  • Create reverse zone 0.0.10.in-addr.arpa
  • Create RFC2317 reverse zone 0-31.0.0.10.in-addr.arpa with rfc2317_parent_managed=True and rfc2317_prefix=10.0.0.0/27
  • Create forward zone, zone1.example.com
  • Create A record name1.zone1.example.com with value 10.0.0.1 and disable_ptr=False
  • Create A record name2.zone1.example.com with value 10.0.0.1 and disable_ptr=False
  • Change the value of A record name2.zone1.example.com to 10.0.0.2

Expected result

  • The value of A record name1.zone1.example.com is now 10.0.0.2
  • There is a PTR record 1.0-31.0.0.10.in-addr.arpa in the RFC2317 zone with value name1.zone1.example.com.
  • There is a PTR record 2.0-31.0.0.10.in-addr.arpa in the RFC2317 zone with value name2.zone1.example.com.
  • CNAME record 1.0.0.10.in-addr.arpa exists in zone 0.0.10.in-addr.arpa with value 1.0-31.0.0.10.in-addr.arpa
  • CNAME record 2.0.0.10.in-addr.arpa exists in zone 0.0.10.in-addr.arpa with value 2.0-31.0.0.10.in-addr.arpa

Actual result

  • CNAME record 1.0.0.10.in-addr.arpa does not exist