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
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.
If you're using a command line utility, it might very well have a switch for forcing ipv4 or ipv6 only.
True; I am using wget. -4 --inet4-only -6 --inet6-only Added --inet4-only to script for now. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)