Add opendns as new provider.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 13 Jul 2014 15:44:33 +0000 (17:44 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 14 Jul 2014 12:04:22 +0000 (14:04 +0200)
README
ddns.conf.sample
src/ddns/providers.py

diff --git a/README b/README
index 6002c19..848a372 100644 (file)
--- a/README
+++ b/README
@@ -61,6 +61,7 @@ SUPPORTED PROVIDERS:
        namecheap.com
        no-ip.com
        nsupdate.info
+       opendns.com
        ovh.com
        regfish.com
        selfhost.de
index cc7f25b..9a62fd3 100644 (file)
 # secret = secret
 # proto = ipv4 OR ipv6
 
+# [test.opendns.com]
+# handle = opendns.com
+# username = user
+# password = pass
+# proto = ipv4 OR ipv6
+
 # [test.ovh.com]
 # provider = ovh.com
 # username = user
index 512d663..3927808 100644 (file)
@@ -772,6 +772,30 @@ class DDNSProviderNsupdateINFO(DDNSProtocolDynDNS2, DDNSProvider):
                return data
 
 
+class DDNSProviderOpenDNS(DDNSProtocolDynDNS2, DDNSProvider):
+       handle    = "opendns.com"
+       name      = "OpenDNS"
+       website   = "http://www.opendns.com"
+
+       # Detailed information about the update request and possible
+       # response codes can be obtained from here:
+       # https://support.opendns.com/entries/23891440
+
+       url = "https://updates.opendns.com/nic/update"
+
+       @property
+       def proto(self):
+               return self.get("proto")
+
+       def _prepare_request_data(self):
+               data = {
+                       "hostname" : self.hostname,
+                       "myip"     : self.get_address(self.proto)
+               }
+
+               return data
+
+
 class DDNSProviderOVH(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "ovh.com"
        name      = "OVH"