DDNS: Fix API call for the "Dynu" DDNS service

This affects the DDNS service "dynu.ca dyn.ee dynserv.(ca|org|net|com)".
DNS updates using this service were made using the URL http://dynserv.ca/ . However,
the domain dynserv.ca does not exist anymore. The Dynu service is now only reachable
via the dynu.com domain. This commit changes the API call according to Dynu's
specification on http://www.dynu.com/Default.aspx?page=dnsapi .
This commit is contained in:
Stefan Ferstl
2014-06-17 11:22:21 +02:00
parent da6424d983
commit 7eb25cb302

View File

@@ -632,23 +632,22 @@ if ($ip ne $ipcache) {
$settings{'HOSTDOMAIN'} = "$settings{'HOSTNAME'}.$settings{'DOMAIN'}";
}
my ($out, $response) = Net::SSLeay::get_http( 'dynserv.ca',
80,
"/dyn/dynengine.cgi?func=set&name=$settings{'LOGIN'}&pass=$settings{'PASSWORD'}&ip=$ip&domain=$settings{'DOMAIN'}",
my ($out, $response) = Net::SSLeay::get_https( 'api.dynu.com',
443,
"/nic/update?hostname=$settings{'HOSTDOMAIN'}&myip=$ip&username=$settings{'LOGIN'}&password=$settings{'PASSWORD'}",
Net::SSLeay::make_headers('User-Agent' => 'IPFire' )
);
#Valid responses from service are:
# 02 == Domain already exists, refreshing data for ... => xxx.xxx.xxx.xxx
#
# Valid responses are 'good xxx.xxx.xxx.xxx', 'nochg'
# see http://www.dynu.com/Default.aspx?page=dnsapi for further details
if ($response =~ m%HTTP/1\.. 200 OK%) {
if ( $out !~ m/Domain already exists, refreshing data for/ig ) {
if ( $out !~ m/^(good|nochg)/ ) {
&General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure ($out)");
} else {
&General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : success");
&General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : success ($out)");
$success++;
}
} else {
&General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server)");
&General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server---$out-$response)");
}
}
elsif ($settings{'SERVICE'} eq 'udmedia') {