netbox-plugin-dns 1.3.4__tar.gz → 1.3.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of netbox-plugin-dns might be problematic. Click here for more details.

Files changed (202) hide show
  1. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/PKG-INFO +1 -1
  2. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/__init__.py +2 -2
  3. netbox_plugin_dns-1.3.6/netbox_dns/management/commands/cleanup_database.py +205 -0
  4. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/management/commands/cleanup_rrset_ttl.py +12 -6
  5. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/management/commands/rebuild_dnssync.py +1 -11
  6. netbox_plugin_dns-1.3.6/netbox_dns/migrations/0023_disable_ptr_false.py +27 -0
  7. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/record.py +26 -1
  8. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/zone.py +6 -1
  9. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/utilities/ipam_dnssync.py +10 -9
  10. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/record.py +5 -1
  11. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_plugin_dns.egg-info/PKG-INFO +1 -1
  12. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_plugin_dns.egg-info/SOURCES.txt +1 -2
  13. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/pyproject.toml +1 -1
  14. netbox_plugin_dns-1.3.4/netbox_dns/management/commands/cleanup_database.py +0 -176
  15. netbox_plugin_dns-1.3.4/netbox_dns/management/commands/remove_orphaned_ptr_records.py +0 -35
  16. netbox_plugin_dns-1.3.4/netbox_dns/management/commands/update_soa.py +0 -22
  17. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/LICENSE +0 -0
  18. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/README.md +0 -0
  19. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/field_serializers.py +0 -0
  20. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/nested_serializers.py +0 -0
  21. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers.py +0 -0
  22. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/__init__.py +0 -0
  23. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/dnssec_key_template.py +0 -0
  24. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/dnssec_policy.py +0 -0
  25. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/nameserver.py +0 -0
  26. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/prefix.py +0 -0
  27. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/record.py +0 -0
  28. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/record_template.py +0 -0
  29. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/registrar.py +0 -0
  30. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/registration_contact.py +0 -0
  31. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/view.py +0 -0
  32. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/zone.py +0 -0
  33. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/serializers_/zone_template.py +0 -0
  34. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/urls.py +0 -0
  35. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/api/views.py +0 -0
  36. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/apps.py +0 -0
  37. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/choices/__init__.py +0 -0
  38. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/choices/dnssec_key_template.py +0 -0
  39. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/choices/dnssec_policy.py +0 -0
  40. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/choices/record.py +0 -0
  41. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/choices/utilities.py +0 -0
  42. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/choices/zone.py +0 -0
  43. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/fields/__init__.py +0 -0
  44. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/fields/address.py +0 -0
  45. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/fields/choice_array.py +0 -0
  46. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/fields/ipam.py +0 -0
  47. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/fields/network.py +0 -0
  48. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/fields/rfc2317.py +0 -0
  49. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/fields/timeperiod.py +0 -0
  50. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/__init__.py +0 -0
  51. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/dnssec_key_template.py +0 -0
  52. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/dnssec_policy.py +0 -0
  53. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/nameserver.py +0 -0
  54. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/record.py +0 -0
  55. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/record_template.py +0 -0
  56. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/registrar.py +0 -0
  57. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/registration_contact.py +0 -0
  58. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/view.py +0 -0
  59. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/zone.py +0 -0
  60. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/filtersets/zone_template.py +0 -0
  61. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/__init__.py +0 -0
  62. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/dnssec_key_template.py +0 -0
  63. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/dnssec_policy.py +0 -0
  64. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/nameserver.py +0 -0
  65. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/record.py +0 -0
  66. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/record_template.py +0 -0
  67. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/registrar.py +0 -0
  68. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/registration_contact.py +0 -0
  69. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/view.py +0 -0
  70. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/zone.py +0 -0
  71. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/forms/zone_template.py +0 -0
  72. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/__init__.py +0 -0
  73. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/enums.py +0 -0
  74. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filter_lookups.py +0 -0
  75. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/__init__.py +0 -0
  76. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/dnssec_key_template.py +0 -0
  77. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/dnssec_policy.py +0 -0
  78. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/nameserver.py +0 -0
  79. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/record.py +0 -0
  80. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/record_template.py +0 -0
  81. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/registrar.py +0 -0
  82. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/registration_contact.py +0 -0
  83. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/view.py +0 -0
  84. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/zone.py +0 -0
  85. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/filters/zone_template.py +0 -0
  86. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/schema.py +0 -0
  87. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/graphql/types.py +0 -0
  88. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  89. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
  90. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/locale/fr/LC_MESSAGES/django.mo +0 -0
  91. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/management/commands/setup_dnssync.py +0 -0
  92. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
  93. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +0 -0
  94. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0002_contact_description_registrar_description.py +0 -0
  95. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0003_default_view.py +0 -0
  96. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0004_create_and_assign_default_view.py +0 -0
  97. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0005_alter_zone_view_not_null.py +0 -0
  98. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0006_templating.py +0 -0
  99. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0007_alter_ordering_options.py +0 -0
  100. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0008_view_prefixes.py +0 -0
  101. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0009_rename_contact_registrationcontact.py +0 -0
  102. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0010_view_ip_address_filter.py +0 -0
  103. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0011_rename_related_fields.py +0 -0
  104. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0012_natural_ordering.py +0 -0
  105. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0013_zonetemplate_soa_mname_zonetemplate_soa_rname.py +0 -0
  106. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0014_alter_unique_constraints_lowercase.py +0 -0
  107. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0015_dnssec.py +0 -0
  108. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0016_dnssec_policy_status.py +0 -0
  109. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0017_dnssec_policy_zone_zone_template.py +0 -0
  110. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0018_zone_domain_status_zone_expiration_date.py +0 -0
  111. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0019_dnssecpolicy_parental_agents.py +0 -0
  112. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
  113. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0020_remove_dnssecpolicy_parental_agents_and_more.py +0 -0
  114. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0021_alter_record_ptr_record.py +0 -0
  115. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
  116. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0022_alter_record_ipam_ip_address.py +0 -0
  117. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0022_search.py +0 -0
  118. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
  119. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0024_tenancy.py +0 -0
  120. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
  121. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0026_domain_registration.py +0 -0
  122. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
  123. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
  124. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
  125. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/migrations/__init__.py +0 -0
  126. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/mixins/__init__.py +0 -0
  127. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/mixins/object_modification.py +0 -0
  128. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/__init__.py +0 -0
  129. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/dnssec_key_template.py +0 -0
  130. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/dnssec_policy.py +0 -0
  131. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/nameserver.py +0 -0
  132. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/record_template.py +0 -0
  133. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/registrar.py +0 -0
  134. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/registration_contact.py +0 -0
  135. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/view.py +0 -0
  136. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/models/zone_template.py +0 -0
  137. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/navigation.py +0 -0
  138. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/signals/__init__.py +0 -0
  139. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/signals/dnssec.py +0 -0
  140. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/signals/ipam_dnssync.py +0 -0
  141. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/__init__.py +0 -0
  142. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/dnssec_key_template.py +0 -0
  143. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/dnssec_policy.py +0 -0
  144. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/ipam_dnssync.py +0 -0
  145. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/nameserver.py +0 -0
  146. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/record.py +0 -0
  147. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/record_template.py +0 -0
  148. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/registrar.py +0 -0
  149. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/registration_contact.py +0 -0
  150. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/view.py +0 -0
  151. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/zone.py +0 -0
  152. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/tables/zone_template.py +0 -0
  153. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/template_content.py +0 -0
  154. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/dnsseckeytemplate.html +0 -0
  155. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/dnssecpolicy.html +0 -0
  156. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
  157. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
  158. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
  159. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/record.html +0 -0
  160. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/recordtemplate.html +0 -0
  161. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/registrar.html +0 -0
  162. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/registrationcontact.html +0 -0
  163. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/view/button.html +0 -0
  164. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/view/prefix.html +0 -0
  165. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/view/related.html +0 -0
  166. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/view.html +0 -0
  167. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
  168. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
  169. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/child_zone.html +0 -0
  170. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/delegation_record.html +0 -0
  171. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
  172. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
  173. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/registration.html +0 -0
  174. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +0 -0
  175. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zone.html +0 -0
  176. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zonetemplate/child.html +0 -0
  177. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templates/netbox_dns/zonetemplate.html +0 -0
  178. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templatetags/__init__.py +0 -0
  179. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/templatetags/netbox_dns.py +0 -0
  180. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/urls.py +0 -0
  181. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/utilities/__init__.py +0 -0
  182. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/utilities/conversions.py +0 -0
  183. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/utilities/dns.py +0 -0
  184. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/validators/__init__.py +0 -0
  185. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/validators/dns_name.py +0 -0
  186. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/validators/dns_value.py +0 -0
  187. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/validators/dnssec.py +0 -0
  188. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/validators/rfc2317.py +0 -0
  189. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/__init__.py +0 -0
  190. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/dnssec_key_template.py +0 -0
  191. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/dnssec_policy.py +0 -0
  192. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/nameserver.py +0 -0
  193. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/record_template.py +0 -0
  194. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/registrar.py +0 -0
  195. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/registration_contact.py +0 -0
  196. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/view.py +0 -0
  197. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/zone.py +0 -0
  198. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_dns/views/zone_template.py +0 -0
  199. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_plugin_dns.egg-info/dependency_links.txt +0 -0
  200. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_plugin_dns.egg-info/requires.txt +0 -0
  201. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/netbox_plugin_dns.egg-info/top_level.txt +0 -0
  202. {netbox_plugin_dns-1.3.4 → netbox_plugin_dns-1.3.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netbox-plugin-dns
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Author-email: Peter Eckel <pete@netbox-dns.org>
6
6
  Project-URL: Homepage, https://github.com/peteeckel/netbox-plugin-dns
@@ -4,7 +4,7 @@ from django.core.exceptions import ImproperlyConfigured
4
4
  from netbox.plugins import PluginConfig
5
5
  from netbox.plugins.utils import get_plugin_config
6
6
 
7
- __version__ = "1.3.4"
7
+ __version__ = "1.3.6"
8
8
 
9
9
 
10
10
  def _check_list(setting):
@@ -16,7 +16,7 @@ class DNSConfig(PluginConfig):
16
16
  name = "netbox_dns"
17
17
  verbose_name = _("NetBox DNS")
18
18
  description = _("NetBox plugin for DNS data")
19
- min_version = "4.3.0"
19
+ min_version = "4.3.2"
20
20
  version = __version__
21
21
  author = "Peter Eckel"
22
22
  author_email = "pete@netbox-dns.org"
@@ -0,0 +1,205 @@
1
+ from netaddr import IPAddress
2
+
3
+ from django.core.management.base import BaseCommand
4
+
5
+ from netbox_dns.models import Zone, Record
6
+ from netbox_dns.choices import RecordTypeChoices
7
+
8
+
9
+ class Command(BaseCommand):
10
+ help = "Clean up NetBox DNS database"
11
+
12
+ def handle(self, *model_names, **options):
13
+ self._zone_cleanup_ns_records(**options)
14
+ self._zone_cleanup_soa_records(**options)
15
+ self._zone_update_arpa_network(**options)
16
+ self._record_cleanup_disable_ptr(**options)
17
+ self._record_update_ptr_records(**options)
18
+ self._record_update_ip_address(**options)
19
+ self._record_remove_orphaned_ptr_records(**options)
20
+ self._record_remove_orphaned_address_records(**options)
21
+
22
+ if options.get("verbosity"):
23
+ self.stdout.write("Database cleanup completed.")
24
+
25
+ def _zone_cleanup_ns_records(self, **options):
26
+ if options.get("verbosity"):
27
+ self.stdout.write("Cleaning up the NS records for all zones")
28
+
29
+ ns_name = "@"
30
+
31
+ for zone in Zone.objects.all():
32
+ nameservers = zone.nameservers.all()
33
+ nameserver_names = [f'{ns.name.rstrip(".")}.' for ns in nameservers]
34
+
35
+ delete_ns = zone.records.filter(
36
+ name=ns_name, type=RecordTypeChoices.NS
37
+ ).exclude(value__in=nameserver_names)
38
+ for record in delete_ns:
39
+ if options.get("verbosity") > 1:
40
+ self.stdout.write(
41
+ f"Removing obsolete NS record '{record}' with value '{record.value}'"
42
+ )
43
+ record.delete()
44
+
45
+ for ns in nameserver_names:
46
+ ns_records = zone.records.filter(
47
+ name=ns_name,
48
+ type=RecordTypeChoices.NS,
49
+ value=ns,
50
+ )
51
+
52
+ delete_ns = ns_records[1:]
53
+ for record in delete_ns:
54
+ if options.get("verbosity") > 1:
55
+ self.stdout.write(
56
+ f"Removing duplicate NS record '{record}' with value '{record.value}'"
57
+ )
58
+ record.delete()
59
+
60
+ try:
61
+ ns_record = zone.records.get(
62
+ name=ns_name,
63
+ type=RecordTypeChoices.NS,
64
+ value=ns,
65
+ )
66
+
67
+ if ns_record.ttl is not None or not ns_record.managed:
68
+ if options.get("verbosity") > 1:
69
+ self.stdout.write(
70
+ f"Updating NS record '{ns_record}' with value '{record.value}'"
71
+ )
72
+ ns_record.ttl = None
73
+ ns_record.managed = True
74
+ ns_record.save()
75
+
76
+ except Record.DoesNotExist:
77
+ if options.get("verbosity") > 1:
78
+ self.stdout.write(
79
+ f"Creating NS record for '{ns.rstrip('.')}' in zone '{zone}'"
80
+ )
81
+ Record.objects.create(
82
+ name=ns_name,
83
+ zone=zone,
84
+ type=RecordTypeChoices.NS,
85
+ value=ns,
86
+ ttl=None,
87
+ managed=True,
88
+ )
89
+
90
+ def _zone_cleanup_soa_records(self, **options):
91
+ if options.get("verbosity"):
92
+ self.stdout.write("Cleaning up the SOA record for all zones")
93
+
94
+ soa_name = "@"
95
+
96
+ for zone in Zone.objects.all():
97
+ delete_soa = zone.records.filter(name=soa_name, type=RecordTypeChoices.SOA)[
98
+ 1:
99
+ ]
100
+ for record in delete_soa:
101
+ if options.get("verbosity") > 1:
102
+ self.stdout.write(
103
+ f"Deleting duplicate SOA record '{record}' for zone '{zone}'"
104
+ )
105
+ record.delete()
106
+
107
+ zone.update_soa_record()
108
+
109
+ def _zone_update_arpa_network(self, **options):
110
+ if options.get("verbosity"):
111
+ self.stdout.write("Updating the ARPA network for reverse zones")
112
+
113
+ for zone in Zone.objects.filter(name__endswith=".arpa"):
114
+ if zone.arpa_network != (arpa_network := zone.network_from_name):
115
+ if options.get("verbosity") > 1:
116
+ self.stdout.write(
117
+ f"Setting the ARPA network for zone '{zone}' to '{arpa_network}'"
118
+ )
119
+
120
+ zone.arpa_network = arpa_network
121
+ zone.save()
122
+
123
+ def _record_cleanup_disable_ptr(self, **options):
124
+ if options.get("verbosity"):
125
+ self.stdout.write("Updating 'Disable PTR' for non-address records")
126
+
127
+ records = Record.objects.filter(
128
+ disable_ptr=True,
129
+ ).exclude(type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA))
130
+
131
+ for record in records:
132
+ if options.get("verbosity") > 1:
133
+ self.stdout.write(
134
+ f"Setting 'Disable PTR' to False for record '{record}'"
135
+ )
136
+
137
+ record.disable_ptr = False
138
+ record.save(update_fields=["disable_ptr"])
139
+
140
+ def _record_update_ptr_records(self, **options):
141
+ if options.get("verbosity"):
142
+ self.stdout.write("Updating the PTR record for all address records")
143
+
144
+ for record in Record.objects.filter(
145
+ type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA)
146
+ ):
147
+ record.save(update_fields=["ptr_record"])
148
+
149
+ def _record_update_ip_address(self, **options):
150
+ if options.get("verbosity"):
151
+ self.stdout.write("Updating the IP address for all address and PTR records")
152
+
153
+ for record in Record.objects.filter(
154
+ type__in=(
155
+ RecordTypeChoices.A,
156
+ RecordTypeChoices.AAAA,
157
+ RecordTypeChoices.PTR,
158
+ )
159
+ ):
160
+ if record.is_ptr_record:
161
+ if record.ip_address != record.address_from_name:
162
+ if options.get("verbosity") > 1:
163
+ self.stdout.write(
164
+ f"Setting the IP Address for pointer record '{record}' to '{record.address_from_name}'"
165
+ )
166
+ record.ip_address = record.address_from_name
167
+ record.save()
168
+ else:
169
+ if record.ip_address != IPAddress(record.value):
170
+ if options.get("verbosity") > 1:
171
+ self.stdout.write(
172
+ f"Updating the IP address for address record '{record}' to '{IPAddress(record.value)}'"
173
+ )
174
+ record.ip_address = record.value
175
+ record.save()
176
+
177
+ def _record_remove_orphaned_ptr_records(self, **options):
178
+ if options.get("verbosity"):
179
+ self.stdout.write("Removing orphaned managed PTR records")
180
+
181
+ orphaned_ptr_records = Record.objects.filter(
182
+ type=RecordTypeChoices.PTR,
183
+ managed=True,
184
+ address_records__isnull=True,
185
+ )
186
+
187
+ for record in orphaned_ptr_records:
188
+ if options.get("verbosity") > 1:
189
+ self.stdout.write(f"Removing orphaned PTR record '{record}'")
190
+ record.delete()
191
+
192
+ def _record_remove_orphaned_address_records(self, **options):
193
+ if options.get("verbosity"):
194
+ self.stdout.write("Removing orphaned managed address records")
195
+
196
+ orphaned_address_records = Record.objects.filter(
197
+ type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA),
198
+ managed=True,
199
+ ipam_ip_address__isnull=True,
200
+ )
201
+
202
+ for record in orphaned_address_records:
203
+ if options.get("verbosity") > 1:
204
+ self.stdout.write(f"Removing orphaned address record '{record}'")
205
+ record.delete()
@@ -22,11 +22,12 @@ class Command(BaseCommand):
22
22
  )
23
23
 
24
24
  def handle(self, *model_names, **options):
25
- self.cleanup_rrset_ttl(**options)
25
+ self._cleanup_rrset_ttl(**options)
26
26
 
27
- self.stdout.write("RRSet cleanup completed.")
27
+ def _cleanup_rrset_ttl(self, **options):
28
+ if options.get("verbosity"):
29
+ self.stdout.write("Cleaning up diverging RRset TTL values")
28
30
 
29
- def cleanup_rrset_ttl(self, **options):
30
31
  ttl_records = (
31
32
  Record.objects.filter(ttl__isnull=False)
32
33
  .exclude(type=RecordTypeChoices.SOA)
@@ -37,11 +38,13 @@ class Command(BaseCommand):
37
38
  name=record.name,
38
39
  zone=record.zone,
39
40
  type=record.type,
40
- ).exclude(type=RecordTypeChoices.PTR, maanged=True)
41
+ ).exclude(type=RecordTypeChoices.PTR, managed=True)
41
42
 
42
43
  if records.count() == 1:
43
44
  if options.get("verbosity") > 2:
44
- self.stdout.write(f"Ignoring single record {record.pk} ({record})")
45
+ self.stdout.write(
46
+ f"Ignoring single record '{record.pk}' ('{record}')"
47
+ )
45
48
  continue
46
49
 
47
50
  if options.get("max"):
@@ -52,7 +55,10 @@ class Command(BaseCommand):
52
55
  for record in records.exclude(ttl=ttl):
53
56
  if options.get("verbosity") > 1:
54
57
  self.stdout.write(
55
- f"Updating TTL for record {record.pk} ({record}) to {ttl}"
58
+ f"Setting TTL for record '{record.pk}' ('{record}') to {ttl}"
56
59
  )
57
60
  record.ttl = ttl
58
61
  record.save(update_fields=["ttl"], update_rrset_ttl=False)
62
+
63
+ if options.get("verbosity"):
64
+ self.stdout.write("RRSet TTL cleanup completed.")
@@ -8,13 +8,6 @@ from netbox_dns.utilities import update_dns_records, get_zones
8
8
  class Command(BaseCommand):
9
9
  help = "Rebuild DNSsync relationships between IP addresses and records"
10
10
 
11
- def add_arguments(self, parser):
12
- parser.add_argument(
13
- "--force",
14
- action="store_true",
15
- help="Update records even if DNS name was not changed (required for rebuilding filtered views",
16
- )
17
-
18
11
  def handle(self, *model_names, **options):
19
12
  ip_addresses = IPAddress.objects.all()
20
13
  for ip_address in ip_addresses:
@@ -24,10 +17,7 @@ class Command(BaseCommand):
24
17
  )
25
18
  if options.get("verbosity") >= 3:
26
19
  self.stdout.write(f" Zones: {get_zones(ip_address)}")
27
- if (
28
- update_dns_records(ip_address, force=options.get("force"))
29
- and options.get("verbosity") >= 1
30
- ):
20
+ if update_dns_records(ip_address) and options.get("verbosity") >= 1:
31
21
  self.stdout.write(
32
22
  f"Updated DNS records for IP Address {ip_address}, VRF {ip_address.vrf}"
33
23
  )
@@ -0,0 +1,27 @@
1
+ # Generated by Django 5.2.3 on 2025-07-30 18:54
2
+
3
+ from django.db import migrations
4
+
5
+ from netbox_dns.choices import RecordTypeChoices
6
+
7
+
8
+ def set_disable_ptr_false(apps, schema_editor):
9
+ Record = apps.get_model("netbox_dns", "Record")
10
+
11
+ for record in Record.objects.exclude(
12
+ type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA)
13
+ ):
14
+ if record.disable_ptr:
15
+ record.disable_ptr = False
16
+ record.save()
17
+
18
+
19
+ class Migration(migrations.Migration):
20
+
21
+ dependencies = [
22
+ ("netbox_dns", "0022_alter_record_ipam_ip_address"),
23
+ ]
24
+
25
+ operations = [
26
+ migrations.RunPython(set_disable_ptr_false),
27
+ ]
@@ -418,6 +418,26 @@ class Record(ObjectModificationMixin, ContactsMixin, NetBoxModel):
418
418
  ):
419
419
  return
420
420
 
421
+ # +
422
+ # If the existing PTR record no longer matches the address record,
423
+ # check whether there is an existing PTR record that does. In that
424
+ # case, mark the old PTR record for cleanup and use the existing one.
425
+ # -
426
+ try:
427
+ existing_ptr_record = Record.objects.get(
428
+ name=ptr_name,
429
+ zone=ptr_zone,
430
+ type=RecordTypeChoices.PTR,
431
+ value=ptr_value,
432
+ )
433
+
434
+ self.cleanup_ptr_record = self.ptr_record
435
+ self.ptr_record = existing_ptr_record
436
+ ptr_record = self.ptr_record
437
+
438
+ except Record.DoesNotExist:
439
+ pass
440
+
421
441
  # +
422
442
  # If there is an RFC2317 CNAME for the PTR record and it is either
423
443
  # not required or needs to be changed, remove it.
@@ -435,10 +455,12 @@ class Record(ObjectModificationMixin, ContactsMixin, NetBoxModel):
435
455
  # modified to match the new name, zone, value and TTL.
436
456
  # -
437
457
  if ptr_record.address_records.count() == 1:
458
+ ptr_record.snapshot()
438
459
  ptr_record.zone = ptr_zone
439
460
  ptr_record.name = ptr_name
440
461
  ptr_record.value = ptr_value
441
462
  ptr_record.ttl = self.ttl
463
+ ptr_record.managed = True
442
464
  ptr_record.save(
443
465
  update_rfc2317_cname=update_rfc2317_cname,
444
466
  save_zone_serial=save_zone_serial,
@@ -447,7 +469,7 @@ class Record(ObjectModificationMixin, ContactsMixin, NetBoxModel):
447
469
 
448
470
  # +
449
471
  # Either there was no PTR record or the existing PTR record could not be re-used,
450
- # so we need to either get find a matching PTR record or create a new one.
472
+ # so we need to either find a matching PTR record or create a new one.
451
473
  # -
452
474
  try:
453
475
  ptr_record = Record.objects.get(
@@ -846,6 +868,9 @@ class Record(ObjectModificationMixin, ContactsMixin, NetBoxModel):
846
868
  if self._state.adding:
847
869
  self.check_unique_rrset_ttl()
848
870
 
871
+ if not self.is_address_record:
872
+ self.disable_ptr = False
873
+
849
874
  if not self.is_active:
850
875
  return
851
876
 
@@ -550,7 +550,12 @@ class Zone(ObjectModificationMixin, ContactsMixin, NetBoxModel):
550
550
  try:
551
551
  soa_record = self.records.get(type=RecordTypeChoices.SOA, name=soa_name)
552
552
 
553
- if soa_record.ttl != soa_ttl or soa_record.value != soa_rdata.to_text():
553
+ if (
554
+ soa_record.ttl != soa_ttl
555
+ or soa_record.value != soa_rdata.to_text()
556
+ or not soa_record.managed
557
+ ):
558
+ soa_record.snapshot()
554
559
  soa_record.ttl = soa_ttl
555
560
  soa_record.value = soa_rdata.to_text()
556
561
  soa_record.managed = True
@@ -177,6 +177,8 @@ def update_dns_records(ip_address, view=None, force=False):
177
177
  address_records = ip_address.netbox_dns_records.filter(zone__view=view)
178
178
 
179
179
  for record in address_records:
180
+ record.snapshot()
181
+
180
182
  if record.zone not in zones or ip_address.custom_field_data.get(
181
183
  "ipaddress_dns_disabled"
182
184
  ):
@@ -185,15 +187,14 @@ def update_dns_records(ip_address, view=None, force=False):
185
187
  continue
186
188
 
187
189
  record.update_fqdn()
188
- if not _match_data(ip_address, record) or force:
189
- updated, deleted = record.update_from_ip_address(ip_address)
190
-
191
- if deleted:
192
- record.delete()
193
- updated = True
194
- elif updated:
195
- record.save()
196
- updated = True
190
+ updated, deleted = record.update_from_ip_address(ip_address)
191
+
192
+ if deleted:
193
+ record.delete()
194
+ updated = True
195
+ elif updated:
196
+ record.save()
197
+ updated = True
197
198
 
198
199
  zones = Zone.objects.filter(pk__in=[zone.pk for zone in zones]).exclude(
199
200
  pk__in=set(ip_address.netbox_dns_records.values_list("zone", flat=True))
@@ -68,7 +68,9 @@ class RecordView(generic.ObjectView):
68
68
  value_fqdn = dns_name.from_text(instance.value_fqdn)
69
69
 
70
70
  cname_targets = Record.objects.filter(
71
- zone__view=instance.zone.view, fqdn=value_fqdn
71
+ zone__view=instance.zone.view,
72
+ fqdn=value_fqdn,
73
+ active=True,
72
74
  )
73
75
 
74
76
  if cname_targets:
@@ -98,6 +100,7 @@ class RecordView(generic.ObjectView):
98
100
  zone__view=instance.zone.view,
99
101
  value=instance.fqdn,
100
102
  type=RecordTypeChoices.CNAME,
103
+ active=True,
101
104
  )
102
105
  )
103
106
 
@@ -112,6 +115,7 @@ class RecordView(generic.ObjectView):
112
115
  zone__view=instance.zone.view,
113
116
  type=RecordTypeChoices.CNAME,
114
117
  zone=parent_zone,
118
+ active=True,
115
119
  )
116
120
  cname_records = cname_records.union(
117
121
  {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netbox-plugin-dns
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Author-email: Peter Eckel <pete@netbox-dns.org>
6
6
  Project-URL: Homepage, https://github.com/peteeckel/netbox-plugin-dns
@@ -80,9 +80,7 @@ netbox_dns/locale/fr/LC_MESSAGES/django.mo
80
80
  netbox_dns/management/commands/cleanup_database.py
81
81
  netbox_dns/management/commands/cleanup_rrset_ttl.py
82
82
  netbox_dns/management/commands/rebuild_dnssync.py
83
- netbox_dns/management/commands/remove_orphaned_ptr_records.py
84
83
  netbox_dns/management/commands/setup_dnssync.py
85
- netbox_dns/management/commands/update_soa.py
86
84
  netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py
87
85
  netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py
88
86
  netbox_dns/migrations/0002_contact_description_registrar_description.py
@@ -110,6 +108,7 @@ netbox_dns/migrations/0021_record_ip_address.py
110
108
  netbox_dns/migrations/0022_alter_record_ipam_ip_address.py
111
109
  netbox_dns/migrations/0022_search.py
112
110
  netbox_dns/migrations/0023_alter_record_value.py
111
+ netbox_dns/migrations/0023_disable_ptr_false.py
113
112
  netbox_dns/migrations/0024_tenancy.py
114
113
  netbox_dns/migrations/0025_ipam_coupling_cf.py
115
114
  netbox_dns/migrations/0026_domain_registration.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "netbox-plugin-dns"
3
- version = "1.3.4"
3
+ version = "1.3.6"
4
4
  description = "NetBox DNS is a NetBox plugin for managing DNS data."
5
5
  authors = [
6
6
  {name="Peter Eckel", email="pete@netbox-dns.org"},
@@ -1,176 +0,0 @@
1
- from netaddr import IPAddress, IPNetwork, AddrFormatError
2
-
3
- from django.core.management.base import BaseCommand
4
-
5
- from netbox_dns.models import Zone, Record
6
- from netbox_dns.choices import ZoneStatusChoices, RecordTypeChoices
7
-
8
-
9
- def zone_rename_passive_status_to_parked(verbose=False):
10
- passive_zones = Zone.objects.filter(status="passive")
11
- if passive_zones:
12
- if verbose:
13
- print("Renaming 'passive' zone status to 'parked'")
14
-
15
- for zone in passive_zones:
16
- zone.status = ZoneStatusChoices.STATUS_PARKED
17
- zone.save()
18
-
19
-
20
- def zone_cleanup_ns_records(verbose=False):
21
- ns_name = "@"
22
-
23
- for zone in Zone.objects.all():
24
- nameservers = zone.nameservers.all()
25
- nameserver_names = [f'{ns.name.rstrip(".")}.' for ns in nameservers]
26
-
27
- delete_ns = zone.records.filter(
28
- name=ns_name, type=RecordTypeChoices.NS
29
- ).exclude(value__in=nameserver_names)
30
- for record in delete_ns:
31
- if verbose:
32
- print(f"Deleting obsolete NS record {record}")
33
- record.delete()
34
-
35
- for ns in nameserver_names:
36
- ns_records = zone.records.filter(
37
- name=ns_name,
38
- type=RecordTypeChoices.NS,
39
- value=ns,
40
- )
41
-
42
- delete_ns = ns_records[1:]
43
- for record in delete_ns:
44
- if verbose:
45
- print(f"Deleting duplicate NS record {record}")
46
- record.delete()
47
-
48
- try:
49
- ns_record = zone.records.get(
50
- name=ns_name,
51
- type=RecordTypeChoices.NS,
52
- value=ns,
53
- )
54
-
55
- if ns_record.ttl is not None or not ns_record.managed:
56
- if verbose:
57
- print(f"Updating NS record '{ns_record}'")
58
- ns_record.ttl = None
59
- ns_record.managed = True
60
- ns_record.save()
61
-
62
- except Record.DoesNotExist:
63
- if verbose:
64
- print(f"Creating NS record for '{ns.rstrip('.')}' in zone '{zone}'")
65
- Record.objects.create(
66
- name=ns_name,
67
- zone=zone,
68
- type=RecordTypeChoices.NS,
69
- value=ns,
70
- ttl=None,
71
- managed=True,
72
- )
73
-
74
-
75
- def zone_update_soa_records(verbose=False):
76
- soa_name = "@"
77
-
78
- for zone in Zone.objects.all():
79
- delete_soa = zone.records.filter(name=soa_name, type=RecordTypeChoices.SOA)[1:]
80
- for record in delete_soa:
81
- if verbose:
82
- print(f"Deleting duplicate SOA record {record}")
83
- record.delete()
84
-
85
- zone.update_soa_record()
86
-
87
-
88
- def zone_update_arpa_network(verbose=False):
89
- for zone in Zone.objects.filter(name__endswith=".arpa"):
90
- name = zone.name
91
-
92
- # TODO: Rewrite with utility function
93
- if name.endswith(".in-addr.arpa"):
94
- address = ".".join(reversed(name.replace(".in-addr.arpa", "").split(".")))
95
- mask = len(address.split(".")) * 8
96
-
97
- try:
98
- prefix = IPNetwork(f"{address}/{mask}")
99
- except AddrFormatError:
100
- prefix = None
101
-
102
- elif name.endswith("ip6.arpa"):
103
- address = "".join(reversed(name.replace(".ip6.arpa", "").split(".")))
104
- mask = len(address)
105
- address = address + "0" * (32 - mask)
106
-
107
- try:
108
- prefix = IPNetwork(
109
- f"{':'.join([(address[i:i+4]) for i in range(0, 32, 4)])}/{mask*4}"
110
- )
111
- except AddrFormatError:
112
- prefix = None
113
- # TODO: End
114
-
115
- if zone.arpa_network != prefix:
116
- if verbose:
117
- print(f"Updating ARPA prefix for zone '{zone}' to '{prefix}'")
118
- zone.arpa_network = prefix
119
- zone.save()
120
-
121
-
122
- def record_cleanup_disable_ptr(verbose=False):
123
- Record.objects.filter(
124
- disable_ptr=False,
125
- ).exclude(
126
- type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA)
127
- ).update(disable_ptr=True)
128
-
129
-
130
- def record_update_ptr_records(verbose=False):
131
- for record in Record.objects.filter(
132
- type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA)
133
- ):
134
- record.save(update_fields=["ptr_record"])
135
-
136
-
137
- def record_update_ip_address(verbose=False):
138
- for record in Record.objects.filter(
139
- type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA, RecordTypeChoices.PTR)
140
- ):
141
- if record.is_ptr_record:
142
- if record.ip_address != record.address_from_name:
143
- if verbose:
144
- print(
145
- f"Updating IP address of pointer record {record} to {record.address_from_name}"
146
- )
147
- record.ip_address = record.address_from_name
148
- record.save()
149
- else:
150
- if record.ip_address != IPAddress(record.value):
151
- if verbose:
152
- print(
153
- f"Updating IP address of address record {record} to {IPAddress(record.value)}"
154
- )
155
- record.ip_address = record.value
156
- record.save()
157
-
158
-
159
- class Command(BaseCommand):
160
- help = "Clean up NetBox DNS database"
161
-
162
- def add_arguments(self, parser):
163
- parser.add_argument(
164
- "--verbose", action="store_true", help="Increase output verbosity"
165
- )
166
-
167
- def handle(self, *model_names, **options):
168
- zone_rename_passive_status_to_parked(options["verbose"])
169
- zone_cleanup_ns_records(options["verbose"])
170
- zone_update_soa_records(options["verbose"])
171
- zone_update_arpa_network(options["verbose"])
172
- record_cleanup_disable_ptr(options["verbose"])
173
- record_update_ptr_records(options["verbose"])
174
- record_update_ip_address(options["verbose"])
175
-
176
- self.stdout.write("Database cleanup completed.")