netbox-plugin-dns 0.22.9__tar.gz → 1.0.0__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 (150) hide show
  1. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/PKG-INFO +27 -13
  2. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/README.md +26 -12
  3. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/__init__.py +4 -15
  4. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/api/nested_serializers.py +4 -60
  5. netbox_plugin_dns-1.0.0/netbox_dns/api/serializers.py +8 -0
  6. netbox_plugin_dns-1.0.0/netbox_dns/api/serializers_/contact.py +37 -0
  7. netbox_plugin_dns-1.0.0/netbox_dns/api/serializers_/nameserver.py +39 -0
  8. netbox_plugin_dns-1.0.0/netbox_dns/api/serializers_/record.py +90 -0
  9. netbox_plugin_dns-1.0.0/netbox_dns/api/serializers_/registrar.py +31 -0
  10. netbox_plugin_dns-1.0.0/netbox_dns/api/serializers_/view.py +34 -0
  11. netbox_plugin_dns-1.0.0/netbox_dns/api/serializers_/zone.py +159 -0
  12. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/api/views.py +13 -13
  13. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/fields/network.py +21 -22
  14. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/fields/rfc2317.py +3 -3
  15. {netbox_plugin_dns-0.22.9/netbox_dns/filters → netbox_plugin_dns-1.0.0/netbox_dns/filtersets}/contact.py +2 -1
  16. netbox_plugin_dns-1.0.0/netbox_dns/filtersets/nameserver.py +37 -0
  17. {netbox_plugin_dns-0.22.9/netbox_dns/filters → netbox_plugin_dns-1.0.0/netbox_dns/filtersets}/record.py +51 -6
  18. {netbox_plugin_dns-0.22.9/netbox_dns/filters → netbox_plugin_dns-1.0.0/netbox_dns/filtersets}/registrar.py +2 -1
  19. {netbox_plugin_dns-0.22.9/netbox_dns/filters → netbox_plugin_dns-1.0.0/netbox_dns/filtersets}/view.py +2 -2
  20. netbox_plugin_dns-1.0.0/netbox_dns/filtersets/zone.py +205 -0
  21. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/forms/contact.py +61 -33
  22. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/forms/nameserver.py +21 -8
  23. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/forms/record.py +65 -38
  24. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/forms/registrar.py +45 -15
  25. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/forms/view.py +23 -9
  26. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/forms/zone.py +182 -188
  27. netbox_plugin_dns-1.0.0/netbox_dns/graphql/__init__.py +17 -0
  28. netbox_plugin_dns-1.0.0/netbox_dns/graphql/filters.py +49 -0
  29. netbox_plugin_dns-1.0.0/netbox_dns/graphql/schema.py +70 -0
  30. netbox_plugin_dns-1.0.0/netbox_dns/graphql/types.py +143 -0
  31. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/management/commands/cleanup_database.py +0 -4
  32. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/management/commands/cleanup_rrset_ttl.py +2 -4
  33. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/management/commands/setup_coupling.py +15 -15
  34. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/management/commands/update_soa.py +1 -1
  35. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -27
  36. netbox_plugin_dns-1.0.0/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +558 -0
  37. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0013_add_nameserver_zone_record_description.py → netbox_plugin_dns-1.0.0/netbox_dns/migrations/0002_contact_description_registrar_description.py +4 -9
  38. netbox_plugin_dns-1.0.0/netbox_dns/migrations/0003_default_view.py +15 -0
  39. netbox_plugin_dns-1.0.0/netbox_dns/migrations/0004_create_and_assign_default_view.py +26 -0
  40. netbox_plugin_dns-1.0.0/netbox_dns/migrations/0005_alter_zone_view_not_null.py +18 -0
  41. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0020_netbox_3_4.py +1 -1
  42. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/models/contact.py +6 -1
  43. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/models/nameserver.py +2 -0
  44. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/models/record.py +28 -33
  45. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/models/registrar.py +5 -1
  46. netbox_plugin_dns-1.0.0/netbox_dns/models/view.py +96 -0
  47. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/models/zone.py +68 -54
  48. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/navigation.py +1 -15
  49. netbox_plugin_dns-1.0.0/netbox_dns/signals/__init__.py +0 -0
  50. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/signals/ipam_coupling.py +3 -9
  51. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/tables/contact.py +1 -0
  52. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/tables/nameserver.py +0 -2
  53. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/tables/registrar.py +1 -0
  54. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/tables/view.py +9 -2
  55. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/template_content.py +4 -8
  56. netbox_plugin_dns-1.0.0/netbox_dns/templates/netbox_dns/contact.html +75 -0
  57. netbox_plugin_dns-1.0.0/netbox_dns/templates/netbox_dns/nameserver.html +42 -0
  58. netbox_plugin_dns-1.0.0/netbox_dns/templates/netbox_dns/record.html +146 -0
  59. netbox_plugin_dns-1.0.0/netbox_dns/templates/netbox_dns/registrar.html +56 -0
  60. netbox_plugin_dns-1.0.0/netbox_dns/templates/netbox_dns/view.html +40 -0
  61. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/zone/base.html +5 -3
  62. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/zone/child.html +3 -3
  63. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/zone/managed_record.html +1 -1
  64. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/zone/record.html +3 -3
  65. netbox_plugin_dns-1.0.0/netbox_dns/templates/netbox_dns/zone/registration.html +39 -0
  66. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +1 -1
  67. netbox_plugin_dns-1.0.0/netbox_dns/templates/netbox_dns/zone.html +177 -0
  68. netbox_plugin_dns-1.0.0/netbox_dns/urls/__init__.py +17 -0
  69. netbox_plugin_dns-1.0.0/netbox_dns/urls/contact.py +51 -0
  70. netbox_plugin_dns-1.0.0/netbox_dns/urls/nameserver.py +69 -0
  71. netbox_plugin_dns-1.0.0/netbox_dns/urls/record.py +41 -0
  72. netbox_plugin_dns-1.0.0/netbox_dns/urls/registrar.py +63 -0
  73. netbox_plugin_dns-1.0.0/netbox_dns/urls/view.py +39 -0
  74. netbox_plugin_dns-1.0.0/netbox_dns/urls/zone.py +57 -0
  75. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/utilities/__init__.py +1 -6
  76. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/utilities/ipam_coupling.py +2 -7
  77. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/validators/dns_name.py +4 -9
  78. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/validators/rfc2317.py +2 -2
  79. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/views/contact.py +4 -4
  80. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/views/nameserver.py +5 -5
  81. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/views/record.py +15 -23
  82. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/views/registrar.py +4 -4
  83. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/views/view.py +4 -4
  84. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/views/zone.py +7 -8
  85. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/pyproject.toml +1 -1
  86. netbox_plugin_dns-0.22.9/netbox_dns/api/serializers.py +0 -314
  87. netbox_plugin_dns-0.22.9/netbox_dns/filters/nameserver.py +0 -18
  88. netbox_plugin_dns-0.22.9/netbox_dns/filters/zone.py +0 -112
  89. netbox_plugin_dns-0.22.9/netbox_dns/graphql/__init__.py +0 -27
  90. netbox_plugin_dns-0.22.9/netbox_dns/graphql/contact.py +0 -19
  91. netbox_plugin_dns-0.22.9/netbox_dns/graphql/nameserver.py +0 -19
  92. netbox_plugin_dns-0.22.9/netbox_dns/graphql/record.py +0 -19
  93. netbox_plugin_dns-0.22.9/netbox_dns/graphql/registrar.py +0 -19
  94. netbox_plugin_dns-0.22.9/netbox_dns/graphql/schema.py +0 -11
  95. netbox_plugin_dns-0.22.9/netbox_dns/graphql/view.py +0 -19
  96. netbox_plugin_dns-0.22.9/netbox_dns/graphql/zone.py +0 -19
  97. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0001_initial.py +0 -115
  98. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0002_zone_default_ttl.py +0 -18
  99. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0003_soa_managed_records.py +0 -112
  100. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0004_create_ptr_for_a_aaaa_records.py +0 -80
  101. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0005_update_ns_records.py +0 -41
  102. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0006_zone_soa_serial_auto.py +0 -29
  103. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0007_alter_zone_soa_serial_auto.py +0 -17
  104. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0008_zone_status_names.py +0 -21
  105. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0009_netbox32.py +0 -71
  106. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0010_update_soa_records.py +0 -58
  107. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0011_add_view_model.py +0 -70
  108. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0012_adjust_zone_and_record.py +0 -17
  109. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0014_add_view_description.py +0 -16
  110. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0015_add_record_status.py +0 -17
  111. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0016_cleanup_ptr_records.py +0 -38
  112. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0017_alter_record_ttl.py +0 -17
  113. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0018_zone_arpa_network.py +0 -51
  114. netbox_plugin_dns-0.22.9/netbox_dns/migrations/0019_update_ns_ttl.py +0 -19
  115. netbox_plugin_dns-0.22.9/netbox_dns/models/view.py +0 -43
  116. netbox_plugin_dns-0.22.9/netbox_dns/templates/netbox_dns/contact.html +0 -71
  117. netbox_plugin_dns-0.22.9/netbox_dns/templates/netbox_dns/nameserver.html +0 -42
  118. netbox_plugin_dns-0.22.9/netbox_dns/templates/netbox_dns/record.html +0 -148
  119. netbox_plugin_dns-0.22.9/netbox_dns/templates/netbox_dns/registrar.html +0 -54
  120. netbox_plugin_dns-0.22.9/netbox_dns/templates/netbox_dns/view.html +0 -36
  121. netbox_plugin_dns-0.22.9/netbox_dns/templates/netbox_dns/zone/registration.html +0 -40
  122. netbox_plugin_dns-0.22.9/netbox_dns/templates/netbox_dns/zone.html +0 -178
  123. netbox_plugin_dns-0.22.9/netbox_dns/urls.py +0 -297
  124. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/LICENSE +0 -0
  125. {netbox_plugin_dns-0.22.9/netbox_dns/migrations → netbox_plugin_dns-1.0.0/netbox_dns/api/serializers_}/__init__.py +0 -0
  126. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/api/urls.py +0 -0
  127. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/apps.py +0 -0
  128. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/fields/__init__.py +0 -0
  129. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/fields/address.py +0 -0
  130. {netbox_plugin_dns-0.22.9/netbox_dns/filters → netbox_plugin_dns-1.0.0/netbox_dns/filtersets}/__init__.py +0 -0
  131. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/forms/__init__.py +0 -0
  132. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
  133. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0022_search.py +0 -0
  134. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
  135. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0024_tenancy.py +0 -0
  136. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
  137. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0026_domain_registration.py +0 -0
  138. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
  139. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
  140. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
  141. {netbox_plugin_dns-0.22.9/netbox_dns/signals → netbox_plugin_dns-1.0.0/netbox_dns/migrations}/__init__.py +0 -0
  142. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/models/__init__.py +0 -0
  143. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/tables/__init__.py +0 -0
  144. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/tables/record.py +0 -0
  145. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/tables/zone.py +0 -0
  146. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
  147. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
  148. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/templates/netbox_dns/related_dns_objects.html +0 -0
  149. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/validators/__init__.py +0 -0
  150. {netbox_plugin_dns-0.22.9 → netbox_plugin_dns-1.0.0}/netbox_dns/views/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: netbox-plugin-dns
3
- Version: 0.22.9
3
+ Version: 1.0.0
4
4
  Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Home-page: https://github.com/peteeckel/netbox-plugin-dns
6
6
  License: MIT
@@ -21,7 +21,7 @@ Project-URL: Repository, https://github.com/peteeckel/netbox-plugin-dns
21
21
  Description-Content-Type: text/markdown
22
22
 
23
23
  # NetBox DNS
24
- The NetBox DNS plugin enables NetBox to manage operational DNS data such as name servers, zones, records and views, as well as registration data for domains. It can automate tasks like creating PTR records, generating zone serial numbers, NS and SOA records, as well as validate names and values values for resource records to ensure zone data is consistent, current and conforming to the relevant RFCs.
24
+ The NetBox DNS plugin enables NetBox to manage operational DNS data such as name servers, zones, records and views, as well as registration data for domains. It can automate tasks like creating PTR records, generating zone serial numbers, NS and SOA records, as well as validate names and values values for resource records to ensure zone data is consistent, up-to-date and compliant with to the relevant RFCs.
25
25
 
26
26
  <div align="center">
27
27
  <a href="https://pypi.org/project/netbox-plugin-dns/"><img src="https://img.shields.io/pypi/v/netbox-plugin-dns" alt="PyPi"/></a>
@@ -36,21 +36,35 @@ The NetBox DNS plugin enables NetBox to manage operational DNS data such as name
36
36
  <a href="https://pepy.tech/project/netbox-plugin-dns"><img alt="Downloads/Month" src="https://static.pepy.tech/badge/netbox-plugin-dns/week"></a>
37
37
  </div>
38
38
 
39
- ## Features
39
+ ## Objectives
40
+ NetBox DNS is designed to be the 'DNS Source of Truth' analogous to NetBox being the 'Network Source of Truth'.
40
41
 
41
- * Manage name servers, zones and records
42
- * Automatically generate SOA and NS records for zones
43
- * Automatically create and update PTR records for IPv4 and IPv6 address records
44
- * Organize DNS zones in views for split horizon DNS and multi-site deployments
45
- * Manage domain registrar and registrant information for domains related to zones
46
- * Manage RFC2317 reverse zones for IPv4 prefixes with a network mask length longer than 24 bits
42
+ The plugin stores information about DNS name servers, DNS views and zones, and DNS records, making it a data source for automatic provisioning of DNS instances. Registration information about DNS registrars and contacts for DNS domains can also be stored and associated with zones.
47
43
 
48
- NetBox DNS is using the standardized NetBox plugin interface, so it also takes advantage of the NetBox tagging and change log features.
44
+ The main focus of the plugin is to ensure the quality of the data stored in it. To achieve this, there are many validation and automation mechanisms in place:
45
+
46
+ * Validation of record names and values
47
+ * Automatic maintenance of PTR records for IPv6 and IPv4 address records
48
+ * Automatic generation of SOA records, optionally including the serial number of the zone data
49
+ * Validation of record types such as CNAME and singletons, to ensure DNS zone validity
50
+ * Support for [RFC 2317](https://datatracker.ietf.org/doc/html/rfc2317) delegation of PTR zones for IPv4 subnets longer than 24 bits
51
+
52
+ Other main features include:
53
+
54
+ * Support for BIND views, providing lightweight namespaces for zones
55
+ * Support for IDN, including the validation of punycode names
56
+ * Full support for the NetBox REST and GraphQL APIs
57
+ * Support for all major NetBox features such as global search, tenancy, change logs, tagging, journaling etc.
58
+
59
+ ## Non-objectives
60
+ In the same way as NetBox is not a network management application, NetBox DNS does not provide any functionality to manage specific name servers or DNS service providers or to generate input such as configuration and zone files for them. The focus is on the completeness and integrity of the data needed to run DNS zones, not on the peculiarities of a plethora of servers and services that actually use the data. This functionality is left to specialized integration tools, or in many cases it can be easily implemented using Ansible or similar tools based on NetBox DNS data. Example code for some simple use cases is provided.
61
+
62
+ For integration with a large number of DNS server implementations integration tools like [octodns-netbox-dns](https://pypi.org/project/octodns-netbox-dns/) are available.
49
63
 
50
64
  ## Requirements
51
65
 
52
- * NetBox 3.5.0 or higher
53
- * Python 3.8 or higher
66
+ * NetBox 4.0.0 or higher
67
+ * Python 3.10 or higher
54
68
 
55
69
  ## Installation & Configuration
56
70
 
@@ -87,7 +101,7 @@ Full documentation on using plugins with NetBox: [Using Plugins - NetBox Documen
87
101
 
88
102
  ## Contribute
89
103
 
90
- Contributions are always welcome! Please see: [contributing guide](CONTRIBUTING.md)
104
+ Contributions are always welcome! Please see the [Contribution Guidelines](CONTRIBUTING.md)
91
105
 
92
106
  ## Documentation
93
107
 
@@ -1,5 +1,5 @@
1
1
  # NetBox DNS
2
- The NetBox DNS plugin enables NetBox to manage operational DNS data such as name servers, zones, records and views, as well as registration data for domains. It can automate tasks like creating PTR records, generating zone serial numbers, NS and SOA records, as well as validate names and values values for resource records to ensure zone data is consistent, current and conforming to the relevant RFCs.
2
+ The NetBox DNS plugin enables NetBox to manage operational DNS data such as name servers, zones, records and views, as well as registration data for domains. It can automate tasks like creating PTR records, generating zone serial numbers, NS and SOA records, as well as validate names and values values for resource records to ensure zone data is consistent, up-to-date and compliant with to the relevant RFCs.
3
3
 
4
4
  <div align="center">
5
5
  <a href="https://pypi.org/project/netbox-plugin-dns/"><img src="https://img.shields.io/pypi/v/netbox-plugin-dns" alt="PyPi"/></a>
@@ -14,21 +14,35 @@ The NetBox DNS plugin enables NetBox to manage operational DNS data such as name
14
14
  <a href="https://pepy.tech/project/netbox-plugin-dns"><img alt="Downloads/Month" src="https://static.pepy.tech/badge/netbox-plugin-dns/week"></a>
15
15
  </div>
16
16
 
17
- ## Features
17
+ ## Objectives
18
+ NetBox DNS is designed to be the 'DNS Source of Truth' analogous to NetBox being the 'Network Source of Truth'.
18
19
 
19
- * Manage name servers, zones and records
20
- * Automatically generate SOA and NS records for zones
21
- * Automatically create and update PTR records for IPv4 and IPv6 address records
22
- * Organize DNS zones in views for split horizon DNS and multi-site deployments
23
- * Manage domain registrar and registrant information for domains related to zones
24
- * Manage RFC2317 reverse zones for IPv4 prefixes with a network mask length longer than 24 bits
20
+ The plugin stores information about DNS name servers, DNS views and zones, and DNS records, making it a data source for automatic provisioning of DNS instances. Registration information about DNS registrars and contacts for DNS domains can also be stored and associated with zones.
25
21
 
26
- NetBox DNS is using the standardized NetBox plugin interface, so it also takes advantage of the NetBox tagging and change log features.
22
+ The main focus of the plugin is to ensure the quality of the data stored in it. To achieve this, there are many validation and automation mechanisms in place:
23
+
24
+ * Validation of record names and values
25
+ * Automatic maintenance of PTR records for IPv6 and IPv4 address records
26
+ * Automatic generation of SOA records, optionally including the serial number of the zone data
27
+ * Validation of record types such as CNAME and singletons, to ensure DNS zone validity
28
+ * Support for [RFC 2317](https://datatracker.ietf.org/doc/html/rfc2317) delegation of PTR zones for IPv4 subnets longer than 24 bits
29
+
30
+ Other main features include:
31
+
32
+ * Support for BIND views, providing lightweight namespaces for zones
33
+ * Support for IDN, including the validation of punycode names
34
+ * Full support for the NetBox REST and GraphQL APIs
35
+ * Support for all major NetBox features such as global search, tenancy, change logs, tagging, journaling etc.
36
+
37
+ ## Non-objectives
38
+ In the same way as NetBox is not a network management application, NetBox DNS does not provide any functionality to manage specific name servers or DNS service providers or to generate input such as configuration and zone files for them. The focus is on the completeness and integrity of the data needed to run DNS zones, not on the peculiarities of a plethora of servers and services that actually use the data. This functionality is left to specialized integration tools, or in many cases it can be easily implemented using Ansible or similar tools based on NetBox DNS data. Example code for some simple use cases is provided.
39
+
40
+ For integration with a large number of DNS server implementations integration tools like [octodns-netbox-dns](https://pypi.org/project/octodns-netbox-dns/) are available.
27
41
 
28
42
  ## Requirements
29
43
 
30
- * NetBox 3.5.0 or higher
31
- * Python 3.8 or higher
44
+ * NetBox 4.0.0 or higher
45
+ * Python 3.10 or higher
32
46
 
33
47
  ## Installation & Configuration
34
48
 
@@ -65,7 +79,7 @@ Full documentation on using plugins with NetBox: [Using Plugins - NetBox Documen
65
79
 
66
80
  ## Contribute
67
81
 
68
- Contributions are always welcome! Please see: [contributing guide](CONTRIBUTING.md)
82
+ Contributions are always welcome! Please see the [Contribution Guidelines](CONTRIBUTING.md)
69
83
 
70
84
  ## Documentation
71
85
 
@@ -1,31 +1,20 @@
1
- import sys
1
+ from netbox.plugins import PluginConfig
2
2
 
3
- from extras.plugins import PluginConfig
4
- from django.db.utils import OperationalError
5
-
6
- try:
7
- # NetBox 3.5.0 - 3.5.7, 3.5.9+
8
- from extras.plugins import get_plugin_config
9
- except ImportError:
10
- # NetBox 3.5.8
11
- from extras.plugins.utils import get_plugin_config
12
-
13
- __version__ = "0.22.9"
3
+ __version__ = "1.0.0"
14
4
 
15
5
 
16
6
  class DNSConfig(PluginConfig):
17
7
  name = "netbox_dns"
18
8
  verbose_name = "NetBox DNS"
19
9
  description = "NetBox plugin for DNS data"
20
- min_version = "3.5.0"
21
- max_version = "3.99.0"
10
+ min_version = "4.0.0"
22
11
  version = __version__
23
12
  author = "Peter Eckel"
24
13
  author_email = "pete@netbox-dns.org"
25
14
  required_settings = []
26
15
  default_settings = {
27
16
  "zone_default_ttl": 86400,
28
- "zone_soa_serial_auto": True,
17
+ "zone_soa_ttl": 86400,
29
18
  "zone_soa_serial": 1,
30
19
  "zone_soa_refresh": 43200,
31
20
  "zone_soa_retry": 7200,
@@ -2,25 +2,10 @@ from rest_framework import serializers
2
2
 
3
3
  from netbox.api.serializers import WritableNestedSerializer
4
4
 
5
- from netbox_dns.models import View, Zone, NameServer, Record, Registrar, Contact
5
+ from netbox_dns.models import Zone, Record
6
+ from netbox_dns.api.serializers_.view import ViewSerializer
6
7
 
7
8
 
8
- #
9
- # Views
10
- #
11
- class NestedViewSerializer(WritableNestedSerializer):
12
- url = serializers.HyperlinkedIdentityField(
13
- view_name="plugins-api:netbox_dns-api:view-detail"
14
- )
15
-
16
- class Meta:
17
- model = View
18
- fields = ["id", "url", "display", "name"]
19
-
20
-
21
- #
22
- # Zones
23
- #
24
9
  class NestedZoneSerializer(WritableNestedSerializer):
25
10
  def to_representation(self, instance):
26
11
  # +
@@ -39,7 +24,8 @@ class NestedZoneSerializer(WritableNestedSerializer):
39
24
  url = serializers.HyperlinkedIdentityField(
40
25
  view_name="plugins-api:netbox_dns-api:zone-detail"
41
26
  )
42
- view = NestedViewSerializer(
27
+ view = ViewSerializer(
28
+ nested=True,
43
29
  many=False,
44
30
  required=False,
45
31
  read_only=True,
@@ -65,22 +51,6 @@ class NestedZoneSerializer(WritableNestedSerializer):
65
51
  ]
66
52
 
67
53
 
68
- #
69
- # Nameservers
70
- #
71
- class NestedNameServerSerializer(WritableNestedSerializer):
72
- url = serializers.HyperlinkedIdentityField(
73
- view_name="plugins-api:netbox_dns-api:nameserver-detail"
74
- )
75
-
76
- class Meta:
77
- model = NameServer
78
- fields = ["id", "url", "display", "name"]
79
-
80
-
81
- #
82
- # Records
83
- #
84
54
  class NestedRecordSerializer(WritableNestedSerializer):
85
55
  url = serializers.HyperlinkedIdentityField(
86
56
  view_name="plugins-api:netbox_dns-api:record-detail"
@@ -110,29 +80,3 @@ class NestedRecordSerializer(WritableNestedSerializer):
110
80
  "zone",
111
81
  "active",
112
82
  ]
113
-
114
-
115
- #
116
- # Registrars
117
- #
118
- class NestedRegistrarSerializer(WritableNestedSerializer):
119
- url = serializers.HyperlinkedIdentityField(
120
- view_name="plugins-api:netbox_dns-api:registrar-detail"
121
- )
122
-
123
- class Meta:
124
- model = Registrar
125
- fields = ["display", "id", "url", "name", "iana_id"]
126
-
127
-
128
- #
129
- # Contacts
130
- #
131
- class NestedContactSerializer(WritableNestedSerializer):
132
- url = serializers.HyperlinkedIdentityField(
133
- view_name="plugins-api:netbox_dns-api:contact-detail"
134
- )
135
-
136
- class Meta:
137
- model = Contact
138
- fields = ["display", "id", "url", "name", "contact_id"]
@@ -0,0 +1,8 @@
1
+ from .serializers_.contact import *
2
+ from .serializers_.nameserver import *
3
+ from .serializers_.record import *
4
+ from .serializers_.registrar import *
5
+ from .serializers_.view import *
6
+ from .serializers_.zone import *
7
+
8
+ from .nested_serializers import *
@@ -0,0 +1,37 @@
1
+ from rest_framework import serializers
2
+
3
+ from netbox.api.serializers import NetBoxModelSerializer
4
+
5
+ from netbox_dns.models import Contact
6
+
7
+
8
+ class ContactSerializer(NetBoxModelSerializer):
9
+ url = serializers.HyperlinkedIdentityField(
10
+ view_name="plugins-api:netbox_dns-api:contact-detail"
11
+ )
12
+
13
+ class Meta:
14
+ model = Contact
15
+ fields = (
16
+ "id",
17
+ "url",
18
+ "display",
19
+ "name",
20
+ "description",
21
+ "contact_id",
22
+ "organization",
23
+ "street",
24
+ "city",
25
+ "state_province",
26
+ "postal_code",
27
+ "country",
28
+ "phone",
29
+ "phone_ext",
30
+ "fax",
31
+ "fax_ext",
32
+ "email",
33
+ "created",
34
+ "last_updated",
35
+ "custom_fields",
36
+ )
37
+ brief_fields = ("id", "url", "display", "name", "description", "contact_id")
@@ -0,0 +1,39 @@
1
+ from rest_framework import serializers
2
+
3
+ from netbox.api.serializers import NetBoxModelSerializer
4
+ from tenancy.api.serializers_.tenants import TenantSerializer
5
+
6
+ from netbox_dns.models import NameServer
7
+
8
+ from netbox_dns.api.nested_serializers import NestedZoneSerializer
9
+
10
+
11
+ class NameServerSerializer(NetBoxModelSerializer):
12
+ url = serializers.HyperlinkedIdentityField(
13
+ view_name="plugins-api:netbox_dns-api:nameserver-detail"
14
+ )
15
+ zones = NestedZoneSerializer(
16
+ many=True,
17
+ read_only=True,
18
+ required=False,
19
+ default=None,
20
+ help_text="Zones served by the authoritative nameserver",
21
+ )
22
+ tenant = TenantSerializer(required=False, allow_null=True)
23
+
24
+ class Meta:
25
+ model = NameServer
26
+ fields = (
27
+ "id",
28
+ "url",
29
+ "display",
30
+ "name",
31
+ "description",
32
+ "tags",
33
+ "zones",
34
+ "created",
35
+ "last_updated",
36
+ "custom_fields",
37
+ "tenant",
38
+ )
39
+ brief_fields = ("id", "url", "display", "name", "description")
@@ -0,0 +1,90 @@
1
+ from rest_framework import serializers
2
+
3
+ from netbox.api.serializers import NetBoxModelSerializer
4
+ from ipam.api.serializers import IPAddressSerializer
5
+ from tenancy.api.serializers import TenantSerializer
6
+
7
+ from netbox_dns.models import Record
8
+ from netbox_dns.api.nested_serializers import (
9
+ NestedZoneSerializer,
10
+ NestedRecordSerializer,
11
+ )
12
+
13
+
14
+ class RecordSerializer(NetBoxModelSerializer):
15
+ url = serializers.HyperlinkedIdentityField(
16
+ view_name="plugins-api:netbox_dns-api:record-detail"
17
+ )
18
+ ptr_record = NestedRecordSerializer(
19
+ many=False,
20
+ read_only=True,
21
+ required=False,
22
+ allow_null=True,
23
+ help_text="PTR record generated from an address",
24
+ )
25
+ address_record = NestedRecordSerializer(
26
+ many=False,
27
+ read_only=True,
28
+ required=False,
29
+ allow_null=True,
30
+ help_text="Address record defining the PTR",
31
+ )
32
+ zone = NestedZoneSerializer(
33
+ many=False,
34
+ required=False,
35
+ help_text="Zone the record belongs to",
36
+ )
37
+ active = serializers.BooleanField(
38
+ required=False,
39
+ read_only=True,
40
+ )
41
+ ipam_ip_address = IPAddressSerializer(
42
+ nested=True,
43
+ many=False,
44
+ read_only=True,
45
+ required=False,
46
+ allow_null=True,
47
+ help_text="IPAddress linked to the record",
48
+ )
49
+ tenant = TenantSerializer(nested=True, required=False, allow_null=True)
50
+
51
+ class Meta:
52
+ model = Record
53
+ fields = (
54
+ "id",
55
+ "url",
56
+ "zone",
57
+ "display",
58
+ "type",
59
+ "name",
60
+ "fqdn",
61
+ "value",
62
+ "status",
63
+ "ttl",
64
+ "description",
65
+ "tags",
66
+ "created",
67
+ "last_updated",
68
+ "managed",
69
+ "disable_ptr",
70
+ "ptr_record",
71
+ "address_record",
72
+ "active",
73
+ "custom_fields",
74
+ "tenant",
75
+ "ipam_ip_address",
76
+ )
77
+ brief_fields = (
78
+ "id",
79
+ "url",
80
+ "zone",
81
+ "display",
82
+ "type",
83
+ "name",
84
+ "fqdn",
85
+ "value",
86
+ "status",
87
+ "ttl",
88
+ "description",
89
+ "active",
90
+ )
@@ -0,0 +1,31 @@
1
+ from rest_framework import serializers
2
+
3
+ from netbox.api.serializers import NetBoxModelSerializer
4
+
5
+ from netbox_dns.models import Registrar
6
+
7
+
8
+ class RegistrarSerializer(NetBoxModelSerializer):
9
+ url = serializers.HyperlinkedIdentityField(
10
+ view_name="plugins-api:netbox_dns-api:registrar-detail"
11
+ )
12
+
13
+ class Meta:
14
+ model = Registrar
15
+ fields = (
16
+ "id",
17
+ "url",
18
+ "display",
19
+ "name",
20
+ "description",
21
+ "iana_id",
22
+ "address",
23
+ "referral_url",
24
+ "whois_server",
25
+ "abuse_email",
26
+ "abuse_phone",
27
+ "created",
28
+ "last_updated",
29
+ "custom_fields",
30
+ )
31
+ brief_fields = ("id", "url", "display", "name", "description", "iana_id")
@@ -0,0 +1,34 @@
1
+ from rest_framework import serializers
2
+
3
+ from netbox.api.serializers import NetBoxModelSerializer
4
+ from tenancy.api.serializers_.tenants import TenantSerializer
5
+
6
+ from netbox_dns.models import View
7
+
8
+
9
+ class ViewSerializer(NetBoxModelSerializer):
10
+ url = serializers.HyperlinkedIdentityField(
11
+ view_name="plugins-api:netbox_dns-api:view-detail"
12
+ )
13
+ default_view = serializers.BooleanField(
14
+ read_only=True,
15
+ )
16
+
17
+ tenant = TenantSerializer(nested=True, required=False, allow_null=True)
18
+
19
+ class Meta:
20
+ model = View
21
+ fields = (
22
+ "id",
23
+ "url",
24
+ "display",
25
+ "name",
26
+ "default_view",
27
+ "tags",
28
+ "description",
29
+ "created",
30
+ "last_updated",
31
+ "custom_fields",
32
+ "tenant",
33
+ )
34
+ brief_fields = ("id", "url", "display", "name", "default_view", "description")
@@ -0,0 +1,159 @@
1
+ from rest_framework import serializers
2
+
3
+ from netbox.api.serializers import NetBoxModelSerializer
4
+ from tenancy.api.serializers_.tenants import TenantSerializer
5
+
6
+ from netbox_dns.api.serializers_.view import ViewSerializer
7
+ from netbox_dns.api.serializers_.nameserver import NameServerSerializer
8
+ from netbox_dns.api.serializers_.registrar import RegistrarSerializer
9
+ from netbox_dns.api.serializers_.contact import ContactSerializer
10
+ from netbox_dns.api.nested_serializers import NestedZoneSerializer
11
+
12
+ from netbox_dns.models import Zone
13
+
14
+
15
+ class ZoneSerializer(NetBoxModelSerializer):
16
+ url = serializers.HyperlinkedIdentityField(
17
+ view_name="plugins-api:netbox_dns-api:zone-detail"
18
+ )
19
+ view = ViewSerializer(
20
+ nested=True,
21
+ many=False,
22
+ read_only=False,
23
+ required=False,
24
+ default=None,
25
+ help_text="View the zone belongs to",
26
+ )
27
+ nameservers = NameServerSerializer(
28
+ nested=True,
29
+ many=True,
30
+ read_only=False,
31
+ required=False,
32
+ help_text="Nameservers for the zone",
33
+ )
34
+ soa_mname = NameServerSerializer(
35
+ nested=True,
36
+ many=False,
37
+ read_only=False,
38
+ required=False,
39
+ help_text="Primary nameserver for the zone",
40
+ )
41
+ rfc2317_parent_zone = NestedZoneSerializer(
42
+ many=False,
43
+ read_only=True,
44
+ required=False,
45
+ help_text="RFC2317 arent zone for the zone",
46
+ )
47
+ rfc2317_child_zones = NestedZoneSerializer(
48
+ many=True,
49
+ read_only=True,
50
+ required=False,
51
+ help_text="RFC2317 child zones of the zone",
52
+ )
53
+ registrar = RegistrarSerializer(
54
+ nested=True,
55
+ many=False,
56
+ read_only=False,
57
+ required=False,
58
+ help_text="The registrar the domain is registered with",
59
+ )
60
+ registrant = ContactSerializer(
61
+ many=False,
62
+ read_only=False,
63
+ required=False,
64
+ help_text="The owner of the domain",
65
+ )
66
+ admin_c = ContactSerializer(
67
+ many=False,
68
+ read_only=False,
69
+ required=False,
70
+ help_text="The administrative contact for the domain",
71
+ )
72
+ tech_c = ContactSerializer(
73
+ many=False,
74
+ read_only=False,
75
+ required=False,
76
+ help_text="The technical contact for the domain",
77
+ )
78
+ billing_c = ContactSerializer(
79
+ many=False,
80
+ read_only=False,
81
+ required=False,
82
+ help_text="The billing contact for the domain",
83
+ )
84
+ active = serializers.BooleanField(
85
+ required=False,
86
+ read_only=True,
87
+ allow_null=True,
88
+ )
89
+ tenant = TenantSerializer(nested=True, required=False, allow_null=True)
90
+
91
+ def create(self, validated_data):
92
+ nameservers = validated_data.pop("nameservers", None)
93
+
94
+ zone = super().create(validated_data)
95
+
96
+ if nameservers is not None:
97
+ zone.nameservers.set(nameservers)
98
+
99
+ return zone
100
+
101
+ def update(self, instance, validated_data):
102
+ nameservers = validated_data.pop("nameservers", None)
103
+
104
+ zone = super().update(instance, validated_data)
105
+
106
+ if nameservers is not None:
107
+ zone.nameservers.set(nameservers)
108
+
109
+ return zone
110
+
111
+ class Meta:
112
+ model = Zone
113
+ fields = (
114
+ "id",
115
+ "url",
116
+ "name",
117
+ "view",
118
+ "display",
119
+ "nameservers",
120
+ "status",
121
+ "description",
122
+ "tags",
123
+ "created",
124
+ "last_updated",
125
+ "default_ttl",
126
+ "soa_ttl",
127
+ "soa_mname",
128
+ "soa_rname",
129
+ "soa_serial",
130
+ "soa_serial_auto",
131
+ "soa_refresh",
132
+ "soa_retry",
133
+ "soa_expire",
134
+ "soa_minimum",
135
+ "rfc2317_prefix",
136
+ "rfc2317_parent_managed",
137
+ "rfc2317_parent_zone",
138
+ "rfc2317_child_zones",
139
+ "registrar",
140
+ "registry_domain_id",
141
+ "registrant",
142
+ "tech_c",
143
+ "admin_c",
144
+ "billing_c",
145
+ "active",
146
+ "custom_fields",
147
+ "tenant",
148
+ )
149
+ brief_fields = (
150
+ "id",
151
+ "url",
152
+ "name",
153
+ "view",
154
+ "display",
155
+ "status",
156
+ "description",
157
+ "rfc2317_prefix",
158
+ "active",
159
+ )