add dns_cyberpanel custom api for acme ssl

This commit is contained in:
usmannasir
2024-10-05 21:47:16 +05:00
parent d6e883ece8
commit afea741bfa
7 changed files with 90 additions and 7 deletions

View File

@@ -313,7 +313,13 @@ class cyberPanel:
def createDNSRecord(self, virtualHostName, name, recordType, value, priority, ttl):
try:
zone = DNS.getZoneObject(virtualHostName)
import tldextract
no_cache_extract = tldextract.TLDExtract(cache_dir=None)
extractDomain = no_cache_extract(virtualHostName)
topLevelDomain = extractDomain.domain + '.' + extractDomain.suffix
zone = DNS.getZoneObject(topLevelDomain)
DNS.createDNSRecord(zone, name, recordType, value, int(priority), int(ttl))
self.printStatus(1, 'None')
except BaseException as msg: