add dns records cloudflare

This commit is contained in:
Usman Nasir
2020-02-10 12:00:16 +05:00
parent d302ab4897
commit 670e5753f2
5 changed files with 211 additions and 7 deletions

View File

@@ -419,6 +419,12 @@ class DNS:
except:
return 0
@staticmethod
def createDNSRecordCloudFlare(cf, zone, name, type, value, priority, ttl):
dns_record = {'name': name, 'type': type, 'content': value, 'ttl': ttl, 'priority': priority}
r = cf.zones.dns_records.post(zone, data=dns_record)
@staticmethod
def createDNSRecord(zone, name, type, value, priority, ttl):
try: