]> git.ipfire.org Git - ddns.git/blobdiff - src/ddns/providers.py
Add new provider it's DNS (https://www.itsdns.de)
[ddns.git] / src / ddns / providers.py
index c482dad107117ff8cc779b73b628d6111fac3b92..4ffd8bff40d4e2427252a56ee79e13bc01e137d8 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # ddns - A dynamic DNS client for IPFire                                      #
-# Copyright (C) 2012 IPFire development team                                  #
+# Copyright (C) 2012-2017 IPFire development team                             #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -400,6 +400,8 @@ class DDNSProtocolDynDNS2(object):
                        raise DDNSInternalServerError(_("DNS error encountered"))
                elif output == "badagent":
                        raise DDNSBlockedError
+               elif output == "badip":
+                       raise DDNSBlockedError
 
                # If we got here, some other update error happened.
                raise DDNSUpdateError(_("Server response: %s") % output)
@@ -828,6 +830,24 @@ class DDNSProviderDuckDNS(DDNSProtocolDynDNS2, DDNSProvider):
        url = "https://www.duckdns.org/nic/update"
 
 
+class DDNSProviderDyFi(DDNSProtocolDynDNS2, DDNSProvider):
+       handle    = "dy.fi"
+       name      = "dy.fi"
+       website   = "https://www.dy.fi/"
+       protocols = ("ipv4",)
+
+       # Information about the format of the request is to be found
+       # https://www.dy.fi/page/clients?lang=en
+       # https://www.dy.fi/page/specification?lang=en
+
+       url = "http://www.dy.fi/nic/update"
+
+       # Please only send automatic updates when your IP address changes,
+       # or once per 5 to 6 days to refresh the address mapping (they will
+       # expire if not refreshed within 7 days).
+       holdoff_days = 6
+
+
 class DDNSProviderDynDNS(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "dyndns.org"
        name      = "Dyn"
@@ -841,6 +861,19 @@ class DDNSProviderDynDNS(DDNSProtocolDynDNS2, DDNSProvider):
        url = "https://members.dyndns.org/nic/update"
 
 
+class DDNSProviderDomainOffensive(DDNSProtocolDynDNS2, DDNSProvider):
+       handle    = "do.de"
+       name      = "Domain-Offensive"
+       website   = "https://www.do.de/"
+       protocols = ("ipv6", "ipv4")
+
+       # Detailed information about the request and response codes
+       # are available on the providers webpage.
+       # https://www.do.de/wiki/FlexDNS_-_Entwickler
+
+       url = "https://ddns.do.de/"
+
+
 class DDNSProviderDynU(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "dynu.com"
        name      = "Dynu"
@@ -1096,6 +1129,18 @@ class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):
                raise DDNSUpdateError
 
 
+class DDNSProviderItsdns(DDNSProtocolDynDNS2, DDNSProvider):
+               handle    = "itsdns.de"
+               name      = "it's DNS"
+               website   = "http://www.itsdns.de/"
+               protocols = ("ipv6", "ipv4")
+
+               # Information about the format of the HTTP request is to be found
+               # here: https://www.itsdns.de/dynupdatehelp.htm
+
+               url = "https://www.itsdns.de/update.php"
+
+
 class DDNSProviderJoker(DDNSProtocolDynDNS2, DDNSProvider):
                handle  = "joker.com"
                name    = "Joker.com Dynamic DNS"
@@ -1271,6 +1316,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 +1482,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 +1510,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 +1791,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>"
-