easydns: Update IPv4 and IPv6 separately
https://kb.easydns.com/knowledge/dynamic-dns/ doesn't say anything about repeating the `myip` parameter, or that both IPv4 and IPv6 addresses can be included in the same `myip` parameter. Unfortunately it also doesn't say whether updating the IPv4 address alone will nuke the IPv6 AAAA record, or whether updating the IPv6 address alone will nuke the IPv4 A record (like Google Domains used to do). Here's hoping that the A and AAAA records are truly independent.
This commit is contained in:
parent
7a4b96e04e
commit
da26fe76e0
2 changed files with 38 additions and 40 deletions
|
@ -124,6 +124,9 @@ repository history](https://github.com/ddclient/ddclient/commits/master).
|
||||||
[#692](https://github.com/ddclient/ddclient/pull/692)
|
[#692](https://github.com/ddclient/ddclient/pull/692)
|
||||||
* `regfishde`: Fixed IPv6 support.
|
* `regfishde`: Fixed IPv6 support.
|
||||||
[#691](https://github.com/ddclient/ddclient/pull/691)
|
[#691](https://github.com/ddclient/ddclient/pull/691)
|
||||||
|
* `easydns`: IPv4 and IPv6 addresses are now updated separately to be
|
||||||
|
consistent with the easyDNS documentation.
|
||||||
|
[#713](https://github.com/ddclient/ddclient/pull/713)
|
||||||
|
|
||||||
## 2023-11-23 v3.11.2
|
## 2023-11-23 v3.11.2
|
||||||
|
|
||||||
|
|
21
ddclient.in
21
ddclient.in
|
@ -4797,14 +4797,11 @@ sub nic_easydns_update {
|
||||||
'TOOSOON' => 'Update frequency is too short.',
|
'TOOSOON' => 'Update frequency is too short.',
|
||||||
);
|
);
|
||||||
for my $h (@_) {
|
for my $h (@_) {
|
||||||
my $ipv4 = delete $config{$h}{'wantipv4'};
|
for my $ipv ('4', '6') {
|
||||||
my $ipv6 = delete $config{$h}{'wantipv6'};
|
my $ip = delete $config{$h}{"wantipv$ipv"} or next;
|
||||||
info("$h: setting IPv4 address to $ipv4") if $ipv4;
|
info("$h: setting IPv$ipv address to $ip");
|
||||||
info("$h: setting IPv6 address to $ipv6") if $ipv6;
|
|
||||||
#'https://api.cp.easydns.com/dyn/generic.php?hostname=test.burry.ca&myip=10.20.30.40&wildcard=ON'
|
#'https://api.cp.easydns.com/dyn/generic.php?hostname=test.burry.ca&myip=10.20.30.40&wildcard=ON'
|
||||||
my $url = "https://$config{$h}{'server'}$config{$h}{'script'}?hostname=$h&myip=";
|
my $url = "https://$config{$h}{'server'}$config{$h}{'script'}?hostname=$h&myip=$ip";
|
||||||
$url .= $ipv4 if $ipv4;
|
|
||||||
$url .= "&myip=$_" for $ipv6;
|
|
||||||
$url .= "&wildcard=" . ynu($config{$h}{'wildcard'}, 'ON', 'OFF', 'OFF')
|
$url .= "&wildcard=" . ynu($config{$h}{'wildcard'}, 'ON', 'OFF', 'OFF')
|
||||||
if defined($config{$h}{'wildcard'});
|
if defined($config{$h}{'wildcard'});
|
||||||
$url .= "&mx=$config{$h}{'mx'}&backmx=" . ynu($config{$h}{'backupmx'}, 'YES', 'NO')
|
$url .= "&mx=$config{$h}{'mx'}&backmx=" . ynu($config{$h}{'backupmx'}, 'YES', 'NO')
|
||||||
|
@ -4825,20 +4822,18 @@ sub nic_easydns_update {
|
||||||
next;
|
next;
|
||||||
};
|
};
|
||||||
my ($status) = $body =~ qr/^(\S*)\b/;
|
my ($status) = $body =~ qr/^(\S*)\b/;
|
||||||
$config{$h}{'status-ipv4'} = $status if $ipv4;
|
$config{$h}{"status-ipv$ipv"} = $status;
|
||||||
$config{$h}{'status-ipv6'} = $status if $ipv6;
|
|
||||||
if ($status eq 'NOERROR') {
|
if ($status eq 'NOERROR') {
|
||||||
$config{$h}{'ipv4'} = $ipv4;
|
$config{$h}{"ipv$ipv"} = $ip;
|
||||||
$config{$h}{'ipv6'} = $ipv6;
|
|
||||||
$config{$h}{'mtime'} = $now;
|
$config{$h}{'mtime'} = $now;
|
||||||
success("$h: IPv4 address set to $ipv4") if $ipv4;
|
success("$h: IPv$ipv address set to $ip");
|
||||||
success("$h: IPv6 address set to $ipv6") if $ipv6;
|
|
||||||
} elsif (exists $errors{$status}) {
|
} elsif (exists $errors{$status}) {
|
||||||
failed("$h: $status: $errors{$status}");
|
failed("$h: $status: $errors{$status}");
|
||||||
} else {
|
} else {
|
||||||
failed("$h: unexpected result: $body");
|
failed("$h: unexpected result: $body");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
Loading…
Reference in a new issue