Every once in a blue moon my ISP changes my public IP address without notice. Most people wouldn't care about this, but I use this information when I'm away to query my security cameras or connect to my Ubuntu MATE server. If I'm out of the house, I have no way to find out what the new IP address is, and that can be frustrating. It's happened to me a couple of times, so I threw together a little automated tool that simply gets my public IP address, compares it to the last known value and sends me a message if it's changed.
I was reviewing scripts and decided to check this one. I manually typed in the command I use
curl -s ifconfig.me
expecting to see my current IPv4 address but instead received my IPv6 address. The check would still work, but my utilities don't use IPv6 (they're old, I guess). I went to https://ifconfig.me and discovered they don't even offer IPv4 anymore. Dang.
Fortunately, I can still find it by simply changing the call in my script to
curl -s ipinfo.io/ip
so I'm still able to run my automated check.
I'm throwing this out there in case anyone is doing something similar. I guess the world is ultimately moving to IPv6, but unless my utilities don't get updated, I'm stuck with IPv4.
I did not use that by myself, but some of my colleagues (who did not rent static IP address from their ISP) configured their home routers to register and use free dynamic DNS.
I do something similiar, but my script automatically updates the DNS and notifies me too.
I use https://ipify.org (also MIT licensed). Their API separates IPv4 and IPv6 so that could be another resource too.
Plain text IPv4:
curl https://api.ipify.org
Plain text IPv6:
curl https://api6.ipify.org
Supports JSON format too!
Our ISP might have started rolling out IPv6, but our router is configured to not obtain an IPv6 address. I disable IPv6 on my system for a local IPv6 address. Not really familiar with them yet, and kind of ugly long, hard to remember addresses. I think IPv4 and IPv6 will still need to co-exist.