From: Stefan Ferstl Date: Tue, 17 Jun 2014 09:22:21 +0000 (+0200) Subject: DDNS: Fix API call for the "Dynu" DDNS service X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=7eb25cb302c28a7969a160a8672df6744c0b85af;hp=-c 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 . --- 7eb25cb302c28a7969a160a8672df6744c0b85af diff --git a/src/scripts/setddns.pl b/src/scripts/setddns.pl index 5e77fce5c..5a195650c 100644 --- a/src/scripts/setddns.pl +++ b/src/scripts/setddns.pl @@ -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') {