From 98fbe467c49c4cdb4a0f7955e1471dfafd7ec9a9 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sat, 21 Jun 2014 18:00:47 +0200 Subject: [PATCH] Add Zoneedit as new provider. --- ddns.conf.sample | 6 ++++++ src/ddns/__init__.py | 1 + src/ddns/providers.py | 48 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/ddns.conf.sample b/ddns.conf.sample index 3e73842..68756f5 100644 --- a/ddns.conf.sample +++ b/ddns.conf.sample @@ -99,3 +99,9 @@ # username = user # password = pass # proto = ipv4 OR ipv6 + +# [test.zoneedit.com] +# provider = zoneedit.com +# username = user +# password = pass +# proto = ipv4 OR ipv6 diff --git a/src/ddns/__init__.py b/src/ddns/__init__.py index a764c2c..65e61d5 100644 --- a/src/ddns/__init__.py +++ b/src/ddns/__init__.py @@ -107,6 +107,7 @@ class DDNSCore(object): DDNSProviderSelfhost, DDNSProviderSPDNS, DDNSProviderVariomedia, + DDNSProviderZoneedit, ): self.register_provider(provider) diff --git a/src/ddns/providers.py b/src/ddns/providers.py index acd0253..06cade8 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -806,3 +806,51 @@ class DDNSProviderVariomedia(DDNSProviderDynDNS): } return data + + +class DDNSProviderZoneedit(DDNSProvider): + INFO = { + "handle" : "zoneedit.com", + "name" : "Zoneedit", + "website" : "http://www.zoneedit.com", + "protocols" : ["ipv6", "ipv4",] + } + + # Detailed information about the request and the response codes can be + # obtained here: + # http://www.zoneedit.com/doc/api/other.html + # http://www.zoneedit.com/faq.html + + url = "https://dynamic.zoneedit.com/auth/dynamic.html" + + @property + def proto(self): + return self.get("proto") + + def update(self): + data = { + "dnsto" : self.get_address(self.proto), + "host" : self.hostname + } + + # Send update to the server. + response = self.send_request(self.url, username=self.username, password=self.password, + data=data) + + # Get the full response message. + output = response.read() + + # Handle success messages. + if output.startswith("