kutzilla / docker-hetzner-ddns

A Docker image that allows you to use Hetzner DNS as a DynDNS Provider
MIT License
23 stars 8 forks source link

IPv6 update seems not to work #13

Open Belgeron opened 2 years ago

Belgeron commented 2 years ago

Hi, i'm running ipv4 and a ipv6 docker container for updates of my domain.

docker run -e ZONE_NAME=mydomain.de -e API_TOKEN= -e RECORD_TYPE=AAAA -e RECORD_NAME=dyn kutzilla/hetzner-ddns

Output is like:

Requesting zone: mydomain.de Started DynDNS

Current public IP is: 37.209.121.234 DNS update required for dyn.mydomain.de with IP 2a02:8070:a85:e900::5a3 Updated DNS for dyn.mydomain.de from IP 2a02:8070:a85:e900::5a3 to IP

Current public IP is: 37.209.121.234 DNS update required for dyn.mydomain.de with IP 2a02:8070:a85:e900::5a3 Updated DNS for dyn.mydomain.de from IP 2a02:8070:a85:e900::5a3 to IP

The ipv6 listed is the one at my zonefile, Current public IP is my IPv4 not the IPv6 and the update fails.

on the same host i'm doing IPv6 updates with ddclient without problems to another dyn dns Hoster but i want to change complete to Hetzner if ipv6 will work.

kutzilla commented 2 years ago

Thanks for sharing this issue. I'm going to look into this.

tgie commented 2 years ago

Hi, I had the same problem. I could solve it by changing the API url of ipify to api64.ipify.org (Main.go Line 98). This only works for IPv6. After the Change only ipv6 works.

kutzilla commented 2 years ago

Hello @tgie,

thanks for sharing your solution. I get the same result. The changed url always provides an IPv6, even though I got an IPv4.

I'm going to make the url changeable by providing the record type. If you are providing an AAAA the DDNS should use the api64.ipify.org. With an A-Record it keeps using ipify.org. Therefore you should receive the v4.

waschinski commented 2 years ago

Any ETA on when this will release?

kutzilla commented 2 years ago

Just released the version 2.1 (see https://github.com/kutzilla/docker-hetzner-ddns/releases/tag/2.1). It includes the fix for IPv6 updates. Unfortunately I don't have the possibility to test it myself with my ISP. Feedback is welcome.

Belgeron commented 2 years ago

Still the same problem for me, now the output looks like:

Started DynDNS
DNS update required for domain.de with current IP 2A02:8070:A81:E200:3125:C77E:936D:2D32 to IP 37.209.121.231
Updated DNS for domain.de from IP 2A02:8070:A81:E200:3125:C77E:936D:2D32 to IP

Now it wants to update an IPv6 to an IPv4

waschinski commented 2 years ago

Same here, but that's probably not an error in the implementation. I guess it's because the docker container does not have a global IPv6 address and even if it, it would have to be the one of the host?

E.g. in my scenario I am running all my docker stuff on a Synology NAS which does have a global and a local IPv6 address. Ports are open on my router for its global IPv6 address. Running a bash script to update hetzner DNS is working fine, because ipify will get the proper IPv6 address but inside the docker-hetzner-ddns container (with only a local IPv6 address) it will always return the IPv4 address even though calling the endpoint for IPv6.

Belgeron commented 2 years ago

You are right, forgot to enable ipv6 for my docker pod. Now it's working with the Zoneupdate and yes, by the use of api64.ipify.org only the IP of the Docker container is updated which is not realy the think you want.

waschinski commented 2 years ago

I guess the container would have to run with network set to host in order to work with IPv6 as intended.

kutzilla commented 2 years ago

Thank you for the feedback. I'll look into that problem once again