diff --git a/.gitignore b/.gitignore index 7dcb236..47424b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ mydata +config.json diff --git a/porkbun-ddns.py b/porkbun-ddns.py index 5c50011..1945f6a 100755 --- a/porkbun-ddns.py +++ b/porkbun-ddns.py @@ -20,7 +20,7 @@ def getMyIP(): def replaceInvalidRecords(): for i in getRecords(rootDomain)["records"]: - if i["name"]==fqdn and (i["type"] == 'A' or i["type"] == 'ALIAS' or i["type"] == 'CNAME'): + if i["name"]==fqdn and (i["type"] == 'A' or i["type"] == 'ALIAS' or i["type"] == 'CNAME') or i["type"] == "MX": if myIP != i["content"]: printIfAllowed("Deleting existing " + i["type"] + " Record") printIfAllowed( "DELETE: " + (json.loads(requests.post(apiConfig["endpoint"] + '/dns/delete/' + rootDomain + '/' + i["id"], data = json.dumps(apiConfig)).text)["status"]) )