Carlos E. R. wrote:
On 2023-03-01 12:37, Per Jessen wrote:
Carlos E. R. wrote:
when a client (e.g. your browser) connects to http://checkip.dns24.ch/, it does a lookup (getaddrinfo) of "checkip.dns24.ch", which will return two addresses. You can check that with "host checkip.dns24.ch". Depending on your setup, your browser will attempt a connection to _one_ of those. That connection will come from a client address that is suitable for the destination. On a typical system with IPv6, it will prefer to use the IPv6 address, and the connecttion will come from an IPv6 address.
Sure, it is obvious.
Ok, then the "solution" would be to have two check IP sites: one that the server is on IPv4, and another where the server is on IPv6 :-)
You can use /etc/gai.conf to set your system's preference, ipv6 over ipv4 or vice versa.
And do that in the script that asks for my current IP in a cronjob? :-D
Well, if you believe it to be necessary, why not. I don't really see which problem you are seeking a solution to, though. If you use "checkip.dns24.ch", you will get an answer that corresponds to your system's abilities and configuration.
You could use addresses instead of names, or you could use the two different dyndns names http://checkip.dyndns.org/ and http://checkipv6.dyndns.org/.
Yes, the second method is what I suggested.
The issue - in my view - is that it means more work on your side, but as I said, it depends on which problem you're trying to solve. -- Per Jessen, Zürich (2.6°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes