+class DDNSProviderDynDNS(DDNSProtocolDynDNS2, DDNSProvider):
+ handle = "dyndns.org"
+ name = "Dyn"
+ website = "http://dyn.com/dns/"
+ protocols = ("ipv4",)
+
+ # Information about the format of the request is to be found
+ # http://http://dyn.com/support/developers/api/perform-update/
+ # http://dyn.com/support/developers/api/return-codes/
+
+ url = "https://members.dyndns.org/nic/update"
+
+
+class DDNSProviderDynU(DDNSProtocolDynDNS2, DDNSProvider):
+ handle = "dynu.com"
+ name = "Dynu"
+ website = "http://dynu.com/"
+ protocols = ("ipv6", "ipv4",)
+
+ # Detailed information about the request and response codes
+ # are available on the providers webpage.
+ # http://dynu.com/Default.aspx?page=dnsapi
+
+ url = "https://api.dynu.com/nic/update"
+
+ # DynU sends the IPv6 and IPv4 address in one request
+
+ def update(self):
+ data = DDNSProtocolDynDNS2.prepare_request_data(self, "ipv4")
+
+ # This one supports IPv6
+ myipv6 = self.get_address("ipv6")
+
+ # Add update information if we have an IPv6 address.
+ if myipv6:
+ data["myipv6"] = myipv6
+
+ self._send_request(data)
+
+
+class DDNSProviderEasyDNS(DDNSProtocolDynDNS2, DDNSProvider):
+ handle = "easydns.com"
+ name = "EasyDNS"
+ website = "http://www.easydns.com/"
+ protocols = ("ipv4",)
+
+ # There is only some basic documentation provided by the vendor,
+ # also searching the web gain very poor results.
+ # http://mediawiki.easydns.com/index.php/Dynamic_DNS
+
+ url = "http://api.cp.easydns.com/dyn/tomato.php"
+
+
+class DDNSProviderDomopoli(DDNSProtocolDynDNS2, DDNSProvider):
+ handle = "domopoli.de"
+ name = "domopoli.de"
+ website = "http://domopoli.de/"
+ protocols = ("ipv4",)
+
+ # https://www.domopoli.de/?page=howto#DynDns_start
+
+ url = "http://dyndns.domopoli.de/nic/update"
+
+
+class DDNSProviderDynsNet(DDNSProvider):
+ handle = "dyns.net"
+ name = "DyNS"
+ website = "http://www.dyns.net/"
+ protocols = ("ipv4",)
+
+ # There is very detailed informatio about how to send the update request and
+ # the possible response codes. (Currently we are using the v1.1 proto)
+ # http://www.dyns.net/documentation/technical/protocol/
+
+ url = "http://www.dyns.net/postscript011.php"
+
+ def update_protocol(self, proto):
+ data = {
+ "ip" : self.get_address(proto),
+ "host" : 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("200"):
+ return
+
+ # Handle error codes.
+ if output.startswith("400"):
+ raise DDNSRequestError(_("Malformed request has been sent."))
+ elif output.startswith("401"):
+ raise DDNSAuthenticationError
+ elif output.startswith("402"):
+ raise DDNSRequestError(_("Too frequent update requests have been sent."))
+ elif output.startswith("403"):
+ raise DDNSInternalServerError
+
+ # If we got here, some other update error happened.
+ raise DDNSUpdateError(_("Server response: %s") % output)
+
+
+class DDNSProviderEnomCom(DDNSResponseParserXML, DDNSProvider):
+ handle = "enom.com"
+ name = "eNom Inc."
+ website = "http://www.enom.com/"
+ protocols = ("ipv4",)
+
+ # There are very detailed information about how to send an update request and
+ # the respone codes.
+ # http://www.enom.com/APICommandCatalog/
+
+ url = "https://dynamic.name-services.com/interface.asp"
+
+ def update_protocol(self, proto):
+ data = {
+ "command" : "setdnshost",
+ "responsetype" : "xml",
+ "address" : self.get_address(proto),
+ "domainpassword" : self.password,
+ "zone" : self.hostname
+ }
+
+ # 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 self.get_xml_tag_value(output, "ErrCount") == "0":
+ return
+
+ # Handle error codes.
+ errorcode = self.get_xml_tag_value(output, "ResponseNumber")
+
+ if errorcode == "304155":
+ raise DDNSAuthenticationError
+ elif errorcode == "304153":
+ raise DDNSRequestError(_("Domain not found."))
+
+ # If we got here, some other update error happened.
+ raise DDNSUpdateError
+
+
+class DDNSProviderEntryDNS(DDNSProvider):
+ handle = "entrydns.net"
+ name = "EntryDNS"
+ website = "http://entrydns.net/"
+ protocols = ("ipv4",)
+
+ # Some very tiny details about their so called "Simple API" can be found
+ # here: https://entrydns.net/help
+ url = "https://entrydns.net/records/modify"
+
+ def update_protocol(self, proto):
+ data = {
+ "ip" : self.get_address(proto),
+ }
+
+ # Add auth token to the update url.
+ url = "%s/%s" % (self.url, self.token)
+
+ # Send update to the server.
+ try:
+ response = self.send_request(url, data=data)
+
+ # Handle error codes
+ except urllib2.HTTPError, e:
+ if e.code == 404:
+ raise DDNSAuthenticationError
+
+ elif e.code == 422:
+ raise DDNSRequestError(_("An invalid IP address was submitted"))
+
+ raise
+
+ # Handle success messages.
+ if response.code == 200:
+ return
+
+ # If we got here, some other update error happened.
+ raise DDNSUpdateError
+
+
+class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):
+ handle = "freedns.afraid.org"
+ name = "freedns.afraid.org"
+ website = "http://freedns.afraid.org/"
+
+ # No information about the request or response could be found on the vendor
+ # page. All used values have been collected by testing.
+ url = "https://freedns.afraid.org/dynamic/update.php"
+
+ def update_protocol(self, proto):
+ data = {
+ "address" : self.get_address(proto),
+ }
+
+ # Add auth token to the update url.
+ url = "%s?%s" % (self.url, self.token)
+
+ # Send update to the server.
+ response = self.send_request(url, data=data)
+
+ # Get the full response message.
+ output = response.read()
+
+ # Handle success messages.
+ if output.startswith("Updated") or "has not changed" in output:
+ return
+
+ # Handle error codes.
+ if output == "ERROR: Unable to locate this record":
+ raise DDNSAuthenticationError
+ elif "is an invalid IP address" in output:
+ raise DDNSRequestError(_("Invalid IP address has been sent."))
+
+ # If we got here, some other update error happened.
+ raise DDNSUpdateError
+
+