Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added All-Inkl v4 and v6 DynDNS support #1725

Merged
merged 4 commits into from Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc
Expand Up @@ -97,6 +97,8 @@ function dyndns_list()

return array(
'3322' => '3322',
'all-inkl' => 'All-Inkl',
'all-inkl-v6' => 'All-Inkl (v6)',
'azure' => 'Azure DNS',
'azurev6' => 'Azure DNS (v6)',
'citynetwork' => 'City Network',
Expand Down
34 changes: 34 additions & 0 deletions dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc
Expand Up @@ -15,6 +15,7 @@
* - _checkIP()
* +----------------------------------------------------+
* 3322 - Last Tested: 26 May 2017
* All-Inkl - Last Tested: 02 March 2020
* Amazon Route53 - Last Tested: 01 April 2012
* Amazon Route53 v6 - Last Tested: 19 November 2017
* Azure DNS - Last Tested: 16 October 2019
Expand Down Expand Up @@ -243,6 +244,7 @@ class updatedns
}

switch ($dnsService) {
case 'all-inkl-v6':
case 'azurev6':
case 'cloudflare-v6':
case 'custom-v6':
Expand Down Expand Up @@ -299,6 +301,8 @@ class updatedns
} else {
switch ($this->_dnsService) {
case '3322':
case 'all-inkl':
case 'all-inkl-v6':
case 'azure':
case 'azurev6':
case 'citynetwork':
Expand Down Expand Up @@ -1178,6 +1182,20 @@ class updatedns
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
break;
case 'all-inkl':
case 'all-inkl-v6':
$server = "https://dyndns.kasserver.com/";
$url = $server . '?myip=' . $this->_dnsIP;
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
// fix: All-Inkl dyndns.kasserver.com only supports v4
$ipv4 = get_interface_ip($this->_dnsRequestIf);
if (!is_ipaddr($ipv4)) {
log_error("Dynamic DNS ({$this->_dnsHost}): (Error) Need a IPv4 address on $this->_dnsRequestIf!");
return false;
}
curl_setopt($ch, CURLOPT_INTERFACE, $ipv4);
// fix end
case 'godaddy':
case 'godaddy-v6':
/* Read https://developer.godaddy.com/ for API documentation */
Expand Down Expand Up @@ -1745,6 +1763,22 @@ class updatedns
$this->_debug($data);
}
break;
case 'all-inkl':
case 'all-inkl-v6':
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (preg_match('/good\s' . $this->_dnsIP . '/i', $data)) {
$status = "Dynamic DNS: (Success) IP Update Successfully!";
$successful_update = true;
} elseif ($http_code == 401) {
$status = "Dynamic DNS: (Error) Authentication failed!";
} elseif (preg_match('/bad\s\(dyndns_target_ip_syntax_incorrect\)/i', $data)) {
$status = "Dynamic DNS: (Error) IP Syntax incorrect ($this->_dnsIP)!";
} else {
$status = "Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case 'godaddy':
case 'godaddy-v6':
/* See https://developer.godaddy.com/ for API documentation, not all codes are handled. */
Expand Down