configure A records for default nameservers'

'
This commit is contained in:
usmannasir
2024-10-06 18:10:17 +05:00
parent 25dca2beb6
commit 7c4e5e71ae
2 changed files with 19 additions and 9 deletions

View File

@@ -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)

View File

@@ -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)