mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-15 03:52:04 +01:00
configure A records for default nameservers'
'
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user