[PR #542] [MERGED] duckdns provider fix ipv6 update #729

Closed
opened 2025-11-20 04:25:51 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/qdm12/ddns-updater/pull/542
Author: @michelwi
Created: 10/13/2023
Status: Merged
Merged: 10/14/2023
Merged by: @qdm12

Base: masterHead: master


📝 Commits (6)

  • 3ff95d6 Duckdns provider verify ipv6
  • 24b6eb1 Duckdns provider verify ipv6
  • a073ef2 Duckdns provider always use ip value
  • b1f2421 Revert always use ip parameter
  • ec9b4d1 duckdns provider fix ipv6 parameter name
  • ba5648a Fix ips scoping

📊 Changes

1 file changed (+7 additions, -2 deletions)

View changed files

📝 internal/provider/providers/duckdns/provider.go (+7 -2)

📄 Description

I am trying to use the duckdns dynamic dns service to assign/update an ipv6. The hostname only has an AAAA record (ipv6) and the A record (ipv4) is empty.
I have encountered two issues that should be fixed with this PR:

First: according to the api documentation

If you do not specify the IP address, then it will be detected - this only works for IPv4 addresses
You can put either an IPv4 or an IPv6 address in the ip parameter
If you want to update BOTH of your IPv4 and IPv6 records at once, then you can use the optional parameter ipv6

The current code in case of ipv4 correctly uses the ip parameter. But in case of ipv6, the ipv6 parameter is used alone without the ip parameter.
This leads to the following behavior:

  • The AAAA record is updated with the new ipv6 as expected
  • As the ip parameter is empty, the ipv4 is automatically detected by duckdns
  • The A record is updated with the found ipv4

In my case, the found ipv4 is some isp provided NAT that I have no control over. So the current behavior is wrong for my use case, but I think it is also not what is intended here.

The proposed change sends both ipv4 and ipv6 to the ip parameter which is the correct thing according to the documentation when updating the ipv6 only.

Edit: after some testing on the command line it seems that the current implementation is correct and the documentation is wrong. I have reverted this part of the PR.
Edit2: the parameter name was wrong. That was why I got an ipv4 update with your code but an ipv6 update on the command line.

Second: when verifying the updated ip, the current code assumes that the ip is ipv4 always. This PR adds the ipv6 case.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/qdm12/ddns-updater/pull/542 **Author:** [@michelwi](https://github.com/michelwi) **Created:** 10/13/2023 **Status:** ✅ Merged **Merged:** 10/14/2023 **Merged by:** [@qdm12](https://github.com/qdm12) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (6) - [`3ff95d6`](https://github.com/qdm12/ddns-updater/commit/3ff95d6c816faa8bc80980de81263440e7f3a13b) Duckdns provider verify ipv6 - [`24b6eb1`](https://github.com/qdm12/ddns-updater/commit/24b6eb1df326b72071edff65f420c8000bdf99a8) Duckdns provider verify ipv6 - [`a073ef2`](https://github.com/qdm12/ddns-updater/commit/a073ef2d1c8b68f1c1e350e1ff1903c68ff4f921) Duckdns provider always use ip value - [`b1f2421`](https://github.com/qdm12/ddns-updater/commit/b1f242170ed4d0b3045c0c66a443a7df5c003ad4) Revert always use ip parameter - [`ec9b4d1`](https://github.com/qdm12/ddns-updater/commit/ec9b4d1ef1a5219617ca3ddff3be90fb2387d8d4) duckdns provider fix ipv6 parameter name - [`ba5648a`](https://github.com/qdm12/ddns-updater/commit/ba5648a3a95ce5b13b45df8828fab4859851da96) Fix ips scoping ### 📊 Changes **1 file changed** (+7 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `internal/provider/providers/duckdns/provider.go` (+7 -2) </details> ### 📄 Description I am trying to use the duckdns dynamic dns service to assign/update an ipv6. The hostname only has an AAAA record (ipv6) and the A record (ipv4) is empty. I have encountered two issues that should be fixed with this PR: ~First: according to the [api documentation](https://www.duckdns.org/spec.jsp)~ > If you do not specify the IP address, then it will be detected - this only works for IPv4 addresses You can put either an IPv4 or an IPv6 address in the ip parameter If you want to update BOTH of your IPv4 and IPv6 records at once, then you can use the optional parameter ipv6 ~The current code in case of ipv4 correctly uses the ip parameter. But in case of ipv6, the ipv6 parameter is used alone without the ip parameter. This leads to the following behavior:~ * ~The AAAA record is updated with the new ipv6 as expected~ * ~As the ip parameter is empty, the ipv4 is automatically detected by duckdns~ * ~The A record is updated with the found ipv4~ ~In my case, the found ipv4 is some isp provided NAT that I have no control over. So the current behavior is wrong for my use case, but I think it is also not what is intended here.~ ~The proposed change sends both ipv4 and ipv6 to the ip parameter which is the correct thing according to the documentation when updating the ipv6 only.~ Edit: after some testing on the command line it seems that the current implementation is correct and the documentation is wrong. I have reverted this part of the PR. Edit2: the parameter name was wrong. That was why I got an ipv4 update with your code but an ipv6 update on the command line. Second: when verifying the updated ip, the current code assumes that the ip is ipv4 always. This PR adds the ipv6 case. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:25:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#729