troglobit / inadyn

In-a-Dyn is a dynamic DNS client with multiple SSL/TLS library support
https://troglobit.com/projects/inadyn/
GNU General Public License v2.0
958 stars 139 forks source link

dynv6.com: Updates IPv6 only #382

Closed henfri closed 2 years ago

henfri commented 2 years ago

Hello,

I am using inadyn 2.9.1 to update my dynv6.com ipv6 address. Unfortunately, inadyn updates the ipv4 adress only:

inadyn --once --force --loglevel=info -n 
inadyn[21819]: In-a-dyn version 2.9.1 -- Dynamic DNS update client.
inadyn[21819]: Guessing DDNS plugin 'default@ipv4.dynv6.com' from 'dynv6.com'
inadyn[21819]: Cached IP# 95.31.101.241 for my.dynv6.net from previous invocation.
inadyn[21819]: Last update of my.dynv6.net on Sun Apr 17 05:41:24 2022
inadyn[21819]: Checking for IP# change, connecting to checkip.dyndns.com([193.122.6.168]:80)
inadyn[21819]: No IP# change detected for **default@ipv4.dynv6.com**, still at 95.31.101.241
inadyn[21819]: Update forced for alias my.dynv6.net, new IP# 95.31.101.241
inadyn[21819]: Sending IP# update to DDNS server, connecting to ipv4.dynv6.com([159.69.43.243]:443)
inadyn[21819]: Sending IP# update to DDNS server, initiating HTTPS ...
inadyn[21819]: SSL connection using ECDHE-RSA-AES128-GCM-SHA256
inadyn[21819]: SSL server cert subject: /CN=dynv6.com
inadyn[21819]: SSL server cert issuer: /C=US/O=Let's Encrypt/CN=R3
inadyn[21819]: Successful alias table update for my.dynv6.net => new IP# 95.31.101.241
inadyn[21819]: Updating cache for my.dynv6.net

What am I doing wrong? I have also tried provider detect_6@dynv6.com { ... But that results in

inadyn[21831]: In-a-dyn version 2.9.1 -- Dynamic DNS update client.
inadyn[21831]: Cannot find an DDNS plugin for provider 'detect_6@dynv6.com'
inadyn[21831]: Error code 74: Missing .conf file

Best regards, Hendrik

acolomb commented 2 years ago

According to your log, it automatically guessed ipv4.dynv6.com as the provider name. Have you tried explicitly using ipv6.dynv6.com?

Do you have the allow-ipv6 option set? Not quite sure about the name, as I'm on mobile.

troglobit commented 2 years ago

@henfri try provider default@dynv6.com { ..., I suspect the matching order for substrings finds the IPv4 entry first, unfortunately. Please let me know if it works, and we'll try swapping the order around.

henfri commented 2 years ago

Hello,

provider ipv6.dynv6.com gives me inadyn[27451]: Cannot find an DDNS plugin for provider 'ipv6.dynv6.com'

provider default@dynv6.com gives me

inadyn[28302]: In-a-dyn version 2.9.1 -- Dynamic DNS update client.
inadyn[28302]: Cached IP# 94.31.101.241 for my.dynv6.net from previous invocation.
inadyn[28302]: Last update of my.dynv6.net on Sun Apr 17 05:44:25 2022
inadyn[28302]: Checking for IP# change, connecting to checkip.dyndns.com([158.101.44.242]:80)
inadyn[28302]: No IP# change detected for default@dynv6.com, still at 94.31.101.241
inadyn[28302]: Update forced for alias my.dynv6.net, new IP# 94.31.101.241
inadyn[28302]: Sending IP# update to DDNS server, connecting to dynv6.com([2a01:4f8:1c1c:4c96::]:443)
inadyn[28302]: Sending IP# update to DDNS server, initiating HTTPS ...
inadyn[28302]: SSL connection using ECDHE-RSA-AES128-GCM-SHA256
inadyn[28302]: SSL server cert subject: /CN=dynv6.com
inadyn[28302]: SSL server cert issuer: /C=US/O=Let's Encrypt/CN=R3
inadyn[28302]: Successful alias table update for my.dynv6.net => new IP# 94.31.101.241
inadyn[28302]: Updating cache for my.dynv6.net

This is not what I want... I want to update the ipv6 but NOT set the IPv4 (as I don't have a real IPv4 Adress).

provider ipv6@dynv6.com gives me

inadyn --once --force --loglevel=info --foreground
inadyn[30050]: In-a-dyn version 2.9.1 -- Dynamic DNS update client.
inadyn[30050]: Cannot find an DDNS plugin for provider 'ipv6@dynv6.com'
inadyn[30050]: Error code 74: Missing .conf file

Any hint?

Best regards, Hendrik

acolomb commented 2 years ago

So default@dynv6.com definitely seems like the right choice. How are you getting the interface address? Might be better to use a checkip server or checkip command to explicitly get the right address family from the interface.

henfri commented 2 years ago

Hello,

So default@dynv6.com definitely seems like the right choice.

Why? It seems to me that ipv6@... Is only updating ipv6 whereas default@... updates both v4 and v6?

How are you getting the interface address?

Up to now: All default.

I tried now with command:

inadyn --once --force --loglevel=info --foreground
inadyn[32220]: In-a-dyn version 2.9.1 -- Dynamic DNS update client.
inadyn[32220]: Cached IP# 94.31.101.241 for my.dynv6.net from previous invocation.
inadyn[32220]: Last update of my.dynv6.net on Mon Apr 18 08:21:32 2022
inadyn[32220]: IPv6 address disallowed, enable with 'allow-ipv6 = true'
inadyn[32220]: Checking for IP# change, connecting to checkip.dyndns.com([193.122.6.168]:80)
inadyn[32220]: No IP# change detected for default@dynv6.com, still at 94.31.101.241
inadyn[32220]: Update forced for alias my.dynv6.net, new IP# 94.31.101.241
inadyn[32220]: Sending IP# update to DDNS server, connecting to dynv6.com([2a01:4f9:c010:95b::]:443)
inadyn[32220]: Sending IP# update to DDNS server, initiating HTTPS ...
inadyn[32220]: SSL connection using ECDHE-RSA-AES128-GCM-SHA256
inadyn[32220]: SSL server cert subject: /CN=dynv6.com
inadyn[32220]: SSL server cert issuer: /C=US/O=Let's Encrypt/CN=R3
inadyn[32220]: Successful alias table update for my.dynv6.net => new IP# 94.31.101.241
inadyn[32220]: Updating cache for my.dynv6.net

with this config:

root@raspberrypi:/etc/wireguard/configs# cat /etc/inadyn.conf
provider default@dynv6.com {
    username = xxxx
    password = n/a
    hostname = { my.dynv6.net }  # second host with comma
    checkip-command = "/sbin/ip -6 addr | grep inet6 | awk -F '[ \t]+|/' '{print $3}' | grep -v ^::1 | grep -v ^fe80"
}

So, as I feared, it updates the ipv4 (which must remain empty) and not the v6.

But that gave me the hint: IPv6 address disallowed, enable with 'allow-ipv6 = true

inadyn --once --force --loglevel=info --foreground
inadyn[2724]: In-a-dyn version 2.9.1 -- Dynamic DNS update client.
inadyn[2724]: Cached IP# 94.31.101.241 for my.dynv6.net from previous invocation.
inadyn[2724]: Last update of my.dynv6.net on Mon Apr 18 18:20:34 2022
inadyn[2724]: Current IP# 2a00:1234:1bfb:c712:ba27:ebff:fe3e:6c55 at default@dynv6.com
inadyn[2724]: Update forced for alias my.dynv6.net, new IP# 2a00:1234:1bfb:c700:ba27:ebff:fe3e:6c55
inadyn[2724]: Sending IP# update to DDNS server, connecting to dynv6.com([2a01:4f8:1c1c:4c96::]:443)
inadyn[2724]: Sending IP# update to DDNS server, initiating HTTPS ...
inadyn[2724]: SSL connection using ECDHE-RSA-AES128-GCM-SHA256
inadyn[2724]: SSL server cert subject: /CN=dynv6.com
inadyn[2724]: SSL server cert issuer: /C=US/O=Let's Encrypt/CN=R3
inadyn[2724]: Successful alias table update for my.dynv6.net => new IP# 2a00:1234:1bfb:c700:ba27:ebff:fe3e:6c55
inadyn[2724]: Updating cache for my.dynv6.net

That with this config:

allow-ipv6 = true
provider default@dynv6.com {

I think it would be good mentioning this (allow-ipv6) would be something useful in the README.

Best regards, Hendrik

troglobit commented 2 years ago

Hi @henfri, great to hear you got it working! The documentation for options is in the manual pages, both inadyn(8) and inadyn.conf(5) are available. In the latter allow-ipv6 is the third option listed, from the top. The README is supposed to be a quick introduction to In-a-dyn (the project) and how to get up and running, not intended to duplicate the documentation.

However, references to the HTML versions of the manual pages should probably be added. We also need more examples of IPv6 setups, since that's one of the most poorly documented aspects of the project. Maybe you could just confirm your final working config, sans username/password, of course? Then I can make sure to add it to the relevant sections.

henfri commented 2 years ago

Hello,

ok, thanks. This is the final configuration:

provider default@dynv6.com {
    username = xxxxxxxx
    password = n/a
    hostname = { my.dynv6.net }  # second host with comma
    checkip-command = "/sbin/ip -6 addr | grep inet6 | awk -F '[ \t]+|/' '{print $3}' | grep -v ^::1 | grep -v ^fe80"
}

Greetings, Hendrik

troglobit commented 2 years ago

Thank you, but didn't you forget allow-ipv6 = true in that final config? From your message before that seemed to be the key config option that unlocked it all?

henfri commented 2 years ago

Sorry, I missed to copy that part.

Complete is:

period          = 300
user-agent      = Mozilla/5.0

allow-ipv6 = true
provider default@dynv6.com {
    username = xxxxxxxx
    password = n/a
    hostname = { my.dynv6.net }  # second host with comma
    checkip-command = "/sbin/ip -6 addr | grep inet6 | awk -F '[ \t]+|/' '{print $3}' | grep -v ^::1 | grep -v ^fe80"
}

Sorry about that.

Greetings, Hendrik

troglobit commented 2 years ago

No worries, thank you for getting back to us! :heart:

troglobit commented 2 years ago

Docs updated, pending man.troglobit.com update.

troglobit commented 2 years ago

There, updated, https://man.troglobit.com/man5/inadyn.conf.5.html

hmijail commented 6 months ago

Just got bitten by another flavor of this issue: the README now mentions the allow-ipv6, but doesn't mention the default@ part. Without it, -l debug shows that inadyn was using ipv4@dynv6.com.

(A default that has to be added explicitly? what kind of default is that?).

I'd suggest that it's better to have a single good source of documentation than having 2 copies out of sync.