]> git.ipfire.org Git - ddns.git/blobdiff - src/ddns/providers.py
Add support for now-dns.com
[ddns.git] / src / ddns / providers.py
index c482dad107117ff8cc779b73b628d6111fac3b92..33238fb44f9ebb865d42ac86879f6f5cb000b762 100644 (file)
@@ -1271,6 +1271,19 @@ class DDNSProviderNOIP(DDNSProtocolDynDNS2, DDNSProvider):
                return data
 
 
+class DDNSProviderNowDNS(DDNSProtocolDynDNS2, DDNSProvider):
+       handle    = "now-dns.com"
+       name      = "NOW-DNS"
+       website   = "http://now-dns.com/"
+       protocols = ("ipv6", "ipv4")
+
+       # Information about the format of the request is to be found
+       # but only can be accessed by register an account and login
+       # https://now-dns.com/?m=api
+
+       url = "https://now-dns.com/update"
+
+
 class DDNSProviderNsupdateINFO(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "nsupdate.info"
        name      = "nsupdate.info"
@@ -1424,6 +1437,17 @@ class DDNSProviderRegfish(DDNSProvider):
                raise DDNSUpdateError
 
 
+class DDNSProviderSchokokeksDNS(DDNSProtocolDynDNS2, DDNSProvider):
+       handle    = "schokokeks.org"
+       name      = "Schokokeks"
+       website   = "http://www.schokokeks.org/"
+       protocols = ("ipv4",)
+
+       # Information about the format of the request is to be found
+       # https://wiki.schokokeks.org/DynDNS
+       url = "https://dyndns.schokokeks.org/nic/update"
+
+
 class DDNSProviderSelfhost(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "selfhost.de"
        name      = "Selfhost.de"
@@ -1441,6 +1465,41 @@ class DDNSProviderSelfhost(DDNSProtocolDynDNS2, DDNSProvider):
                return data
 
 
+class DDNSProviderServercow(DDNSProvider):
+       handle    = "servercow.de"
+       name      = "servercow.de"
+       website   = "https://servercow.de/"
+       protocols = ("ipv4", "ipv6")
+
+       url = "https://www.servercow.de/dnsupdate/update.php"
+       can_remove_records = False
+
+       def update_protocol(self, proto):
+               data = {
+                       "ipaddr"   : self.get_address(proto),
+                       "hostname" : self.hostname,
+                       "username" : self.username,
+                       "pass"     : self.password,
+               }
+
+               # Send request to provider
+               response = self.send_request(self.url, data=data)
+
+               # Read response
+               output = response.read()
+
+               # Server responds with OK if update was successful
+               if output.startswith("OK"):
+                       return
+
+               # Catch any errors
+               elif output.startswith("FAILED - Authentication failed"):
+                       raise DDNSAuthenticationError
+
+               # If we got here, some other update error happened
+               raise DDNSUpdateError(output)
+
+
 class DDNSProviderSPDNS(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "spdns.org"
        name      = "SPDYN"
@@ -1687,15 +1746,3 @@ class DDNSProviderZZZZ(DDNSProvider):
 
                # If we got here, some other update error happened.
                raise DDNSUpdateError
-
-class DDNSProviderSchokokeksDNS(DDNSProtocolDynDNS2, DDNSProvider):
-       handle    = "schokokeks.org"
-       name      = "Schokokeks"
-       website   = "http://www.schokokeks.org/"
-       protocols = ("ipv4",)
-
-       # Information about the format of the request is to be found
-       # https://wiki.schokokeks.org/DynDNS
-
-       url = "https://dyndns.schokokeks.org/nic/update?myip=<ipaddr>"
-