diff --git a/dns/dnsManager.py b/dns/dnsManager.py index ded8c2edd..538110d76 100755 --- a/dns/dnsManager.py +++ b/dns/dnsManager.py @@ -618,6 +618,25 @@ class DNSManager: writeToFile.write(nsContent.rstrip('\n')) writeToFile.close() + ### + + import tldextract + + no_cache_extract = tldextract.TLDExtract(cache_dir=None) + + + + nsData = open(DNSManager.defaultNameServersPath, 'r').readlines() + + for ns in nsData: + extractDomain = no_cache_extract(ns.rstrip('\n')) + topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix + + zone = Domains.objects.get(name=topLevelDomain) + + DNS.createDNSRecord(zone, ns, 'A', ACLManager.fetchIP(), 0, 1400) + + final_dic = {'status': 1, 'error_message': "None"} final_json = json.dumps(final_dic) diff --git a/plogical/dnsUtilities.py b/plogical/dnsUtilities.py index 1816b4c47..24f13f724 100755 --- a/plogical/dnsUtilities.py +++ b/plogical/dnsUtilities.py @@ -562,15 +562,6 @@ class DNS: def createDKIMRecords(domain): try: - command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.6/site-packages/tldextract/.suffix_cache' - ProcessUtilities.executioner(command) - - command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python3.8/site-packages/tldextract/.suffix_cache' - ProcessUtilities.executioner(command) - - command = 'chown cyberpanel:cyberpanel -R /usr/local/CyberCP/lib/python*/site-packages/tldextract/.suffix_cache' - ProcessUtilities.executioner(command, None, True) - import tldextract no_cache_extract = tldextract.TLDExtract(cache_dir=None)