Pick your poison as you wish - either is great! :-)
curl -4 https://www.cloudflare.com/cdn-cgi/trace
curl -6 https://www.cloudflare.com/cdn-cgi/trace
Also the reason that the 1.1.1.1 one shows only IPv4 address is because 1.1.1.1 is itself an IPv4 address. So any connection to it will have to be using IPv4.Listen, if you want to check the IPv6 address from the interface list go ahead I’m not trying to stop you.
But because I anyway need to reach a third party to know my own IPv4 address then yeah when that third party can also tell me IPv6 address I’m gonna do it that way.
Every device gets a public ipv6 (usually).
The router is connected to the internal network in my home and has the IP address of 192.168.1.1.
Behind the router is my computer which has a non-public IP address, for example 192.168.1.2. My computer is the one I want to run the program to update the DNS entry. My computer does not know what the public IP address is by looking at its interfaces.
https://superuser.com/questions/468727/how-to-get-the-ipv6-i...
I do not like to have the servers/computers that are on the internal home network directly connected to the Internet.
current_ip=$(curl -s -X GET https://1.1.1.1/cdn-cgi/trace | grep -Po "(?<=ip=)(.*)") grep -Po "(?<=ip=)(.*)"
with awk -F= '$1 == "ip" { print $2 }'