mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-12 00:06:09 +01:00
Support for DNS CAA record type
This commit is contained in:
15
dns/views.py
15
dns/views.py
@@ -342,6 +342,8 @@ def getCurrentRecordsForDomain(request):
|
||||
fetchType = 'SOA'
|
||||
elif currentSelection == 'srvRecord':
|
||||
fetchType = 'SRV'
|
||||
elif currentSelection == 'caaRecord':
|
||||
fetchType = 'CAA'
|
||||
|
||||
json_data = "["
|
||||
checker = 0
|
||||
@@ -528,6 +530,19 @@ def addDNSRecord(request):
|
||||
priority = data['priority']
|
||||
|
||||
DNS.createDNSRecord(zone, value, recordType, recordContentSRV, priority, ttl)
|
||||
elif recordType == "CAA":
|
||||
|
||||
if recordName == "@":
|
||||
value = zoneDomain
|
||||
## re.match
|
||||
elif match(r'([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?', recordName, M | I):
|
||||
value = recordName
|
||||
else:
|
||||
value = recordName + "." + zoneDomain
|
||||
|
||||
recordContentCAA = data['recordContentCAA'] ## IP or ponting value
|
||||
|
||||
DNS.createDNSRecord(zone, value, recordType, recordContentCAA, 0, ttl)
|
||||
|
||||
|
||||
final_dic = {'add_status': 1, 'error_message': "None"}
|
||||
|
||||
Reference in New Issue
Block a user