netbox-plugin-dns 1.3.5__py3-none-any.whl → 1.3.6__py3-none-any.whl

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.

netbox_dns/__init__.py CHANGED
@@ -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.5"
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"
@@ -186,7 +186,7 @@ class Command(BaseCommand):
186
186
 
187
187
  for record in orphaned_ptr_records:
188
188
  if options.get("verbosity") > 1:
189
- self.stdout.write("Removing orphaned PTR record '{record}'")
189
+ self.stdout.write(f"Removing orphaned PTR record '{record}'")
190
190
  record.delete()
191
191
 
192
192
  def _record_remove_orphaned_address_records(self, **options):
@@ -201,5 +201,5 @@ class Command(BaseCommand):
201
201
 
202
202
  for record in orphaned_address_records:
203
203
  if options.get("verbosity") > 1:
204
- self.stdout.write("Removing orphaned address record '{record}'")
204
+ self.stdout.write(f"Removing orphaned address record '{record}'")
205
205
  record.delete()
@@ -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
+ ]
@@ -187,15 +187,14 @@ def update_dns_records(ip_address, view=None, force=False):
187
187
  continue
188
188
 
189
189
  record.update_fqdn()
190
- if not _match_data(ip_address, record) or force:
191
- updated, deleted = record.update_from_ip_address(ip_address)
192
-
193
- if deleted:
194
- record.delete()
195
- updated = True
196
- elif updated:
197
- record.save()
198
- 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
199
198
 
200
199
  zones = Zone.objects.filter(pk__in=[zone.pk for zone in zones]).exclude(
201
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.5
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
@@ -1,4 +1,4 @@
1
- netbox_dns/__init__.py,sha256=-aNWTjZrScH61wzPGKzqdWwZf8ojcrz1HXDy7OBqi1o,4890
1
+ netbox_dns/__init__.py,sha256=xq8VZKxTI6bdiMeHJM-s2IPaZTbGczYbTTEy8B3174w,4890
2
2
  netbox_dns/apps.py,sha256=JCW5eS-AQBUubDJve1DjP-IRFKTFGQh1NLGWzJpC5MI,151
3
3
  netbox_dns/navigation.py,sha256=ZF2-bKRfuxXnLArSCvozyRXRd7GME14sVJZdmDEMhBk,7741
4
4
  netbox_dns/template_content.py,sha256=nwjbWkMc02vpTmcFQdiAA1TdopJiZ0MkRy6qa18_wLI,4848
@@ -74,9 +74,9 @@ netbox_dns/graphql/filters/zone_template.py,sha256=6ZxBN_VPXvBDGXXwcYlkX6wJXx_Il
74
74
  netbox_dns/locale/de/LC_MESSAGES/django.mo,sha256=fSlYDunygrkHE4TAIlHI0ol67Lz3qiu2hUkeirewlOQ,29995
75
75
  netbox_dns/locale/en/LC_MESSAGES/django.mo,sha256=GDnSZkfHs3yjtTsll7dksEEej4B50F8pc9RGytZNubM,393
76
76
  netbox_dns/locale/fr/LC_MESSAGES/django.mo,sha256=hZjbClaXZndP8VtqAiXWBdYEFVD9CQrKJXelL6kMOPE,30021
77
- netbox_dns/management/commands/cleanup_database.py,sha256=bkMdDlZpSzqIRx18N86wyda2ufFzNlejefyeRdHg5Nk,7951
77
+ netbox_dns/management/commands/cleanup_database.py,sha256=Dv1DCN55MzIHoQk3TBV-SmaNf_mFo-PbzCm7fOmZspY,7953
78
78
  netbox_dns/management/commands/cleanup_rrset_ttl.py,sha256=7W4_qRzm_Crnb1L4X8lfrXRJanBqDGLC1yCLvrIaGG4,2256
79
- netbox_dns/management/commands/rebuild_dnssync.py,sha256=SlY-NsMu4BJ7Bi1lnswfVHjhCzsgL6hRue6pJXSO_0w,1247
79
+ netbox_dns/management/commands/rebuild_dnssync.py,sha256=Wnix38pzuC1AtGm9-xU8W8j7NYLlUIMpmw5mT2rhBYc,929
80
80
  netbox_dns/management/commands/setup_dnssync.py,sha256=qtVj6egSjclaQbuI60hLfl-zg89VJVbX-TB17f1k77Y,5730
81
81
  netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py,sha256=3U0810NWSHPu2dTSHpfzlleDgwMS04FhJ_CkO76SDaw,10283
82
82
  netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py,sha256=ML6Hp17lrXiaG0eUlBjKMm6HUNhw0AHPnKrb9AN-F6E,20279
@@ -105,6 +105,7 @@ netbox_dns/migrations/0021_record_ip_address.py,sha256=EqdhWXmq7aiK4X79xTRUZng3z
105
105
  netbox_dns/migrations/0022_alter_record_ipam_ip_address.py,sha256=KKmB3moxPJBKytOBymy0tS6ABIKjpNd5YY6cG--Lluk,727
106
106
  netbox_dns/migrations/0022_search.py,sha256=KW1ffEZ4-0dppGQ_KD1EN7iw8eQJOnDco-xfJFRZqKQ,172
107
107
  netbox_dns/migrations/0023_alter_record_value.py,sha256=4_4v8YZzU8_jadJqIUUjH6SIhNTeALWhclozTqYDmv0,378
108
+ netbox_dns/migrations/0023_disable_ptr_false.py,sha256=Wo-d60QmPCcvdVIVShF8L7z-L2eofJwWTIiyrr51bjU,652
108
109
  netbox_dns/migrations/0024_tenancy.py,sha256=3kc5l5_AyfhOI6g6mbCfReUAbSgb2DAv0MDMZqJ-3YQ,1745
109
110
  netbox_dns/migrations/0025_ipam_coupling_cf.py,sha256=7uHujclWrsYw5QMLWft0Po78Ow5Q8MjPuU7moKyQ2qs,620
110
111
  netbox_dns/migrations/0026_domain_registration.py,sha256=qUJ1oUGHIGGNWD7QRLnxElbM5eNp7dYNNn_OYIw8Xvo,5796
@@ -169,7 +170,7 @@ netbox_dns/templatetags/netbox_dns.py,sha256=DND1DMPzv636Rak3M6Hor_Vw6pjqUfSTquo
169
170
  netbox_dns/utilities/__init__.py,sha256=cSGf-nGaRWx9b-Xrh3dLMJYoWNsZ6FF-qdmV4F1uOgg,74
170
171
  netbox_dns/utilities/conversions.py,sha256=qYnzecmR28l8Je_H0vFvzJ2sikTiEiyxr6drl_aRocg,3016
171
172
  netbox_dns/utilities/dns.py,sha256=UBiyQe8thiOTnKOmU9e2iRHHnGF9toVLe4efU623kX4,322
172
- netbox_dns/utilities/ipam_dnssync.py,sha256=qVbJAL2GcTpKZaz4XBfTc4Gn8xREukQy0VvhK6jIpQ8,10493
173
+ netbox_dns/utilities/ipam_dnssync.py,sha256=PZXnn2TIPhCMh9Mxjbl9LfP63w0lMPRzO1lNPDyYpVo,10404
173
174
  netbox_dns/validators/__init__.py,sha256=X0hPZlC3VZcXMcvXKZ2_5LSoEJdXPNSBr4QtEIFSBJ0,94
174
175
  netbox_dns/validators/dns_name.py,sha256=1MKnYAmkSTIQGf6zInqkpbIj5SCeCM0YGKmYOqFzUK4,3770
175
176
  netbox_dns/validators/dns_value.py,sha256=cADhgTohXAtOLPzaoMKO9DahEUiDanpdiuKonrwFw0E,5278
@@ -179,15 +180,15 @@ netbox_dns/views/__init__.py,sha256=tObkTOHw_6kVtEcwdyshN0Ql-8VGhwsgQw7owL_s2lI,
179
180
  netbox_dns/views/dnssec_key_template.py,sha256=06omBc2RCTltGH078mNLLwz3A_y9gqrtQ08ex1XEwlg,2694
180
181
  netbox_dns/views/dnssec_policy.py,sha256=ZvkCVfvI78w8e9c0m8lSWgRwg-jg07PM8Od0HwAVjGI,4427
181
182
  netbox_dns/views/nameserver.py,sha256=cLB0W1UnnvEmYdoCYH5HmjrFhbEZ1gWxJTKdMS-wuh0,3564
182
- netbox_dns/views/record.py,sha256=cPvsc20EUFcVidQ9YGIdsSTLHZKYzZD3JcV9bFv7iak,7123
183
+ netbox_dns/views/record.py,sha256=eAHMxsd2xKL9Yc_lijSC28RkvDnOolh-tdYLxb0d9aA,7219
183
184
  netbox_dns/views/record_template.py,sha256=Cye1rjlpAewRgIv7QGD7o5n-knjzqjEUJzZHVxtGX4s,3041
184
185
  netbox_dns/views/registrar.py,sha256=gYpMyz3rRJDmBfEeRfVENvR6fdWXN1y0XbN4JBlXoHc,2625
185
186
  netbox_dns/views/registration_contact.py,sha256=5bJWjNBisqCkBo6d2TJyyBJlc95WM7VcSA6wsEB184k,3383
186
187
  netbox_dns/views/view.py,sha256=xLXt7sKrda3FpNXsBSJk8L8P2XhZ1sVb5OOXovCsKEU,3089
187
188
  netbox_dns/views/zone.py,sha256=rxf0ETFnBF88JbhxUZWtcid_CAm7tssYfp2EFjk7zyg,7160
188
189
  netbox_dns/views/zone_template.py,sha256=5P9DT3XBRL-TiM5zFhBTMlMusL4bP2jTu3GHxKz5ojc,2553
189
- netbox_plugin_dns-1.3.5.dist-info/licenses/LICENSE,sha256=I3tDu11bZfhFm3EkV4zOD5TmWgLjnUNLEFwrdjniZYs,1112
190
- netbox_plugin_dns-1.3.5.dist-info/METADATA,sha256=eG5VsqM5B-Boc4GvUAc8VG7GuUQTXiFkcrMHEz0I1WA,7787
191
- netbox_plugin_dns-1.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
192
- netbox_plugin_dns-1.3.5.dist-info/top_level.txt,sha256=sA1Rwl1mRKvMC6XHe2ylZ1GF-Q1NGd08XedK9Y4xZc4,11
193
- netbox_plugin_dns-1.3.5.dist-info/RECORD,,
190
+ netbox_plugin_dns-1.3.6.dist-info/licenses/LICENSE,sha256=I3tDu11bZfhFm3EkV4zOD5TmWgLjnUNLEFwrdjniZYs,1112
191
+ netbox_plugin_dns-1.3.6.dist-info/METADATA,sha256=cOlM0ppA8UzYmjsx5LD8j-tPLRr6TthsafOgcDh1w0w,7787
192
+ netbox_plugin_dns-1.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
193
+ netbox_plugin_dns-1.3.6.dist-info/top_level.txt,sha256=sA1Rwl1mRKvMC6XHe2ylZ1GF-Q1NGd08XedK9Y4xZc4,11
194
+ netbox_plugin_dns-1.3.6.dist-info/RECORD,,