mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 10:38:41 -04:00
[PR #542] [MERGED] duckdns provider fix ipv6 update #729
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
master← Head:master📝 Commits (6)
3ff95d6Duckdns provider verify ipv624b6eb1Duckdns provider verify ipv6a073ef2Duckdns provider always use ip valueb1f2421Revert always use ip parameterec9b4d1duckdns provider fix ipv6 parameter nameba5648aFix 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 documentationThe 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 expectedAs the ip parameter is empty, the ipv4 is automatically detected by duckdnsThe A record is updated with the found ipv4In 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.