mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-08 17:33:46 +02: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)
|
||||
|
||||
Reference in New Issue
Block a user