diff --git a/README.md b/README.md index 0b987ce..952a7d8 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Dynamic DNS services currently supported include: Freemyip - See https://freemyip.com for details woima.fi - See https://woima.fi/ for details Yandex - See https://domain.yandex.com/ for details + DNS Made Easy - See https://dnsmadeeasy.com/ for details DDclient now supports many of cable/dsl broadband routers. diff --git a/README.ssl b/README.ssl index ed8d19b..27b9f5b 100644 --- a/README.ssl +++ b/README.ssl @@ -9,3 +9,4 @@ On alpine, you need perl-io-socket-ssl to have IO::Socket::SSL ssl support is tested on folowing dynamic dns providers: - dyndns.com - freemyip.com +- DNS Made Easy diff --git a/ddclient b/ddclient index 3df4aff..a1c4912 100755 --- a/ddclient +++ b/ddclient @@ -486,6 +486,10 @@ my %variables = ( 'yandex-common-defaults' => { 'server' => setv(T_FQDNP, 1, 0, 1, 'pddimp.yandex.ru', undef), }, + 'dnsmadeeasy-common-defaults' => { + 'server' => setv(T_FQDNP, 1, 0, 1, 'cp.dnsmadeeasy.com', undef), + 'script' => setv(T_STRING, 1, 1, 1, '/servlet/updateip', undef), + }, ); my %services = ( 'dyndns1' => { @@ -698,6 +702,15 @@ my %services = ( $variables{'service-common-defaults'}, ), }, + 'dnsmadeeasy' => { + 'updateable' => undef, + 'update' => \&nic_dnsmadeeasy_update, + 'examples' => \&nic_dnsmadeeasy_examples, + 'variables' => merge( + $variables{'dnsmadeeasy-common-defaults'}, + $variables{'service-common-defaults'}, + ), + }, ); $variables{'merged'} = merge($variables{'global-defaults'}, $variables{'service-common-defaults'}, @@ -4812,6 +4825,93 @@ sub nic_woima_update { } } +###################################################################### +## nic_dnsmadeeasy_examples +###################################################################### +sub nic_dnsmadeeasy_examples { + return < 'Invalid username or password, or invalid IP syntax', + 'error-auth-suspend' => 'User has had their account suspended due to complaints or misuse of the service.', + 'error-auth-voided' => 'User has had their account permanently revoked.', + 'error-record-invalid' =>'Record ID number does not exist in the system.', + 'error-record-auth' => 'User does not have access to this record.', + 'error-record-ip-same' => 'No update required.', + 'error-system' => 'General system error which is caught and recognized by the system.', + 'error' => 'General system error unrecognized by the system.', + 'success' => 'Record successfully updated!', + ); + + foreach my $h (@_) { + my $ip = delete $config{$h}{'wantip'}; + info("Setting IP address to %s for %s", $ip, $h); + verbose("UPDATE:","Updating %s", $h); + + # Set the URL that we're going to to update + my $url; + $url = $globals{'ssl'} ? "https://" : "http://"; + $url .= $config{$h}{'server'}.$config{$h}{'script'}; + $url .= "?username=$config{$h}{'login'}"; + $url .= "&password=$config{$h}{'password'}"; + $url .= "&ip=$ip"; + $url .= "&id=$h"; + + # Try to get URL + my $reply = geturl(opt('proxy'), $url); + + # No response, declare as failed + if (!defined($reply) || !$reply) { + failed("Updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); + last; + } + last if !header_ok($h, $reply); + + my @reply = split /\n/, $reply; + my $returned = pop(@reply); + if ($returned =~ 'success') + { + $config{$h}{'ip'} = $ip; + $config{$h}{'mtime'} = $now; + $config{$h}{'status'} = 'good'; + success("Updating %s: good: IP address set to %s", $h, $ip); + } + else + { + $config{$h}{'status'} = 'failed'; + failed("Updating %s: Server said: '$returned': $messages{$returned}", $h); + } + } +} + ###################################################################### # vim: ai ts=4 sw=4 tw=78 : diff --git a/sample-etc_ddclient.conf b/sample-etc_ddclient.conf index ed896b7..ab3e574 100644 --- a/sample-etc_ddclient.conf +++ b/sample-etc_ddclient.conf @@ -241,7 +241,7 @@ ssl=yes # use ssl-support. Works with # password=your-myonlineportal-password # domain.myonlineportal.net -## +## ## nsupdate.info IPV4(https://www.nsupdate.info) ## #protocol=dyndns2 @@ -269,3 +269,10 @@ ssl=yes # use ssl-support. Works with # login=domain.tld, \ # password=yandex-pdd-token \ # my.domain.tld,other.domain.tld \ + +## DNS Made Easy (https://dnsmadeeasy.com) +## +# protocol=dnsmadeeasy, +# login=your-account-email-address +# password=your-generated-password +# your-numeric-record-id-1,your-numeric-record-id-2,...