Commit 80fbdd50 authored by Franco Fichtner's avatar Franco Fichtner

dyndns: add support for STRATO

(cherry picked from commit a84f3c0d)
parent a8a4c067
...@@ -119,6 +119,7 @@ function dyndns_list() ...@@ -119,6 +119,7 @@ function dyndns_list()
'ovh-dynhost' => 'OVH DynHOST', 'ovh-dynhost' => 'OVH DynHOST',
'route53' => 'Route 53', 'route53' => 'Route 53',
'selfhost' => 'SelfHost', 'selfhost' => 'SelfHost',
'strato' => 'STRATO',
'zoneedit' => 'ZoneEdit', 'zoneedit' => 'ZoneEdit',
); );
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
* - City Network (citynetwork.se) * - City Network (citynetwork.se)
* - Duck DNS (duckdns.org) * - Duck DNS (duckdns.org)
* - Google Domains (domains.google.com) * - Google Domains (domains.google.com)
* - STRATO (strato.com)
* +----------------------------------------------------+ * +----------------------------------------------------+
* Requirements: * Requirements:
* - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library * - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library
...@@ -77,6 +78,7 @@ ...@@ -77,6 +78,7 @@
* City Network - Last Tested: 13 November 2013 * City Network - Last Tested: 13 November 2013
* Duck DNS - Last Tested: 04 March 2015 * Duck DNS - Last Tested: 04 March 2015
* Google Domains - Last Tested: 20 February 2017 * Google Domains - Last Tested: 20 February 2017
* STRATO - Last Tested: 09 May 2017
* +====================================================+ * +====================================================+
* *
* @author E.Kristensen * @author E.Kristensen
...@@ -86,7 +88,6 @@ ...@@ -86,7 +88,6 @@
* *
* DNSexit/OpenDNS support and multiwan extension for pfSense by Ermal Luci * DNSexit/OpenDNS support and multiwan extension for pfSense by Ermal Luci
* Custom DNS support by Matt Corallo * Custom DNS support by Matt Corallo
*
*/ */
class updatedns { class updatedns {
...@@ -221,38 +222,39 @@ class updatedns { ...@@ -221,38 +222,39 @@ class updatedns {
$this->_error(10); $this->_error(10);
} else { } else {
switch ($this->_dnsService) { switch ($this->_dnsService) {
case 'citynetwork':
case 'cloudflare':
case 'custom':
case 'custom-v6':
case 'dhs':
case 'dnsexit':
case 'dnsomatic': case 'dnsomatic':
case 'duckdns':
case 'dyndns': case 'dyndns':
case 'dyndns-static':
case 'dyndns-custom': case 'dyndns-custom':
case 'dhs': case 'dyndns-static':
case 'noip':
case 'noip-free':
case 'easydns':
case 'hn':
case 'zoneedit':
case 'dyns': case 'dyns':
case 'ods': case 'easydns':
case 'eurodns':
case 'freedns': case 'freedns':
case 'loopia': case 'googledomains':
case 'staticcling': case 'gratisdns':
case 'dnsexit':
case 'custom':
case 'custom-v6':
case 'opendns':
case 'namecheap':
case 'he-net': case 'he-net':
case 'he-net-v6':
case 'selfhost':
case 'he-net-tunnelbroker': case 'he-net-tunnelbroker':
case 'route53': case 'he-net-v6':
case 'cloudflare': case 'hn':
case 'eurodns': case 'loopia':
case 'gratisdns': case 'namecheap':
case 'noip':
case 'noip-free':
case 'ods':
case 'opendns':
case 'ovh-dynhost': case 'ovh-dynhost':
case 'googledomains': case 'route53':
case 'citynetwork': case 'selfhost':
case 'duckdns': case 'strato':
case 'staticcling':
case 'zoneedit':
$this->_update(); $this->_update();
if($this->_dnsDummyUpdateDone == true) { if($this->_dnsDummyUpdateDone == true) {
// If a dummy update was needed, then sleep a while and do the update again to put the proper address back. // If a dummy update was needed, then sleep a while and do the update again to put the proper address back.
...@@ -713,6 +715,15 @@ class updatedns { ...@@ -713,6 +715,15 @@ class updatedns {
curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch, CURLOPT_URL, $server);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
break; break;
case 'strato':
if ($this->_dnsVerboseLog)
log_error("STRATO: ({$this->_dnsHost}): DNS update() starting.");
$server = "https://dyndns.strato.com/nic/update?hostname={$this->_dnsHost}&myip={$this->_dnsIP}";
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
curl_setopt($ch, CURLOPT_URL, $server);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
break;
default: default:
break; break;
} }
...@@ -1220,6 +1231,7 @@ class updatedns { ...@@ -1220,6 +1231,7 @@ class updatedns {
} }
break; break;
case 'googledomains': case 'googledomains':
case 'strato':
if (preg_match('/notfqdn/i', $data)) { if (preg_match('/notfqdn/i', $data)) {
$status = "Dynamic DNS: (Error) Not a FQDN"; $status = "Dynamic DNS: (Error) Not a FQDN";
} else if (preg_match('/nochg/i', $data)) { } else if (preg_match('/nochg/i', $data)) {
...@@ -1243,6 +1255,7 @@ class updatedns { ...@@ -1243,6 +1255,7 @@ class updatedns {
log_error("Dynamic DNS: PAYLOAD: {$data}"); log_error("Dynamic DNS: PAYLOAD: {$data}");
$this->_debug($data); $this->_debug($data);
} }
break;
} }
if($successful_update == true) { if($successful_update == true) {
...@@ -1410,13 +1423,13 @@ class updatedns { ...@@ -1410,13 +1423,13 @@ class updatedns {
$ip_address = get_dyndns_ip($this->_if, $his->_useIPv6 ? 6 : 4); $ip_address = get_dyndns_ip($this->_if, $his->_useIPv6 ? 6 : 4);
if (!is_ipaddr($ip_address)) { if (!is_ipaddr($ip_address)) {
if ($this->_dnsVerboseLog) { if ($this->_dnsVerboseLog) {
log_error("Dynamic DNS ({$this->_dnsHost}): IP address could not be extracted from {$hosttocheck}"); log_error("Dynamic DNS ({$this->_dnsHost}): IP address could not be extracted");
} }
$ip_address = 0; $ip_address = 0;
} else { } else {
if ($this->_dnsVerboseLog) { if ($this->_dnsVerboseLog) {
log_error("Dynamic DNS ({$this->_dnsHost}): {$ip_address} extracted from {$hosttocheck}"); log_error("Dynamic DNS ({$this->_dnsHost}): {$ip_address} extracted");
} }
$this->_dnsIP = $ip_address; $this->_dnsIP = $ip_address;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment