Skip to content

Commit

Permalink
bug fix: soa parsing ref #1341
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Oct 23, 2024
1 parent bfc2fc4 commit fd05ec4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions plogical/dnsUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,11 +680,16 @@ def createDNSRecord(zone, name, type, value, priority, ttl):
return

if zone.type == 'MASTER':
getSOA = Records.objects.get(domainOwner=zone, type='SOA')
soaContent = getSOA.content.split(' ')
soaContent[2] = str(int(soaContent[2]) + 1)
getSOA.content = " ".join(soaContent)
getSOA.save()
try:
for getSOA in Records.objects.filter(domainOwner=zone, type='SOA'):
#getSOA = Records.objects.get(domainOwner=zone, type='SOA')
soaContent = getSOA.content.split(' ')
soaContent[2] = str(int(soaContent[2]) + 1)
getSOA.content = " ".join(soaContent)
getSOA.save()
except:
pass


if type == 'NS':
if Records.objects.filter(name=name, type=type, content=value).count() == 0:
Expand Down

0 comments on commit fd05ec4

Please sign in to comment.