From: Marco Götze Date: Wed, 22 Apr 2015 18:36:07 +0000 (+0200) Subject: Add DNSmadeEasy as new provider. X-Git-Tag: 008~2 X-Git-Url: http://git.ipfire.org/?p=oddments%2Fddns.git;a=commitdiff_plain;h=d1cb1b54e167ef1d238c704f162ed9afaa8f9c14 Add DNSmadeEasy as new provider. Fixes #10811. Signed-off-by: Stefan Schantl --- diff --git a/README b/README index 4ae3883..9e924a1 100644 --- a/README +++ b/README @@ -53,6 +53,7 @@ SUPPORTED PROVIDERS: ddnss.de dhs.org dns.lightningwirelabs.com + dnsmadeeasy.com dnspark.com domains.google.com domopoli.de diff --git a/ddns.conf.sample b/ddns.conf.sample index 0cab899..bc42319 100644 --- a/ddns.conf.sample +++ b/ddns.conf.sample @@ -53,6 +53,11 @@ # username = user # password = pass +# [test.dnsmadeeasy.com] +# provider = dnsmadeeasy.com +# username = user +# password = pass + # [test.dtdns.org] # provider = dtdns.org # password = pass diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 9eaaa6c..e708fd6 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1552,6 +1552,54 @@ class DDNSProviderZoneedit(DDNSProvider): raise DDNSUpdateError +class DDNSProviderDNSmadeEasy(DDNSProvider): + handle = "dnsmadeeasy.com" + name = "DNSmadeEasy.com" + website = "http://www.dnsmadeeasy.com/" + protocols = ("ipv4",) + + # DNS Made Easy Nameserver Provider also offering Dynamic DNS + # Documentation can be found here: + # http://www.dnsmadeeasy.com/dynamic-dns/ + + url = "https://cp.dnsmadeeasy.com/servlet/updateip?" + can_remove_records = False + + def update_protocol(self, proto): + data = { + "ip" : self.get_address(proto), + "id" : self.hostname, + "username" : self.username, + "password" : self.password, + } + + # Send update to the server. + response = self.send_request(self.url, data=data) + + # Get the full response message. + output = response.read() + + # Handle success messages. + if output.startswith("success") or output.startswith("error-record-ip-same"): + return + + # Handle error codes. + if output.startswith("error-auth-suspend"): + raise DDNSRequestError(_("Account has been suspended.")) + + elif output.startswith("error-auth-voided"): + raise DDNSRequestError(_("Account has been revoked.")) + + elif output.startswith("error-record-invalid"): + raise DDNSRequestError(_("Specified host does not exist.")) + + elif output.startswith("error-auth"): + raise DDNSAuthenticationError + + # If we got here, some other update error happened. + raise DDNSUpdateError(_("Server response: %s") % output) + + class DDNSProviderZZZZ(DDNSProvider): handle = "zzzz.io" name = "zzzz"