

0·
21 days agodig -6 +short .opendns.com myip.opendns.com AAAA
Note: You have to ensure you are actually contacting the server with IPv6.


dig -6 +short .opendns.com myip.opendns.com AAAA
Note: You have to ensure you are actually contacting the server with IPv6.


I worry less about the service breaking, changing, or otherwise disappearing, over a random website.
EDIT: Also what was said in a sibling comment.


I saw it used in another comment, and am already aware of the use of curl for such a task, but choose to query DNS services instead—especially in scripts.


#!/usr/bin/sh
dig -4 +short @resolver2.opendns.com myip.opendns.com
#!/usr/bin/pwsh
Resolve-DnsName -Server resolver2.opendns.com -Name myip.opendns.com -Type A | % { echo $_.IPAddress }
There should be an IPv6 resolver, but I don’t remember and am currently unable to test. My PowerShell skills are also effectively non-existent.
My fuzzy memory wants to say it uses/is based atop UDP, and makes it more reliable.
Just checked before posting, and that seems to be the case on a cursory glance of its wiki article: https://en.wikipedia.org/wiki/QUIC