Dynamically update DNS entries via API calls

I’d just wanted to post and put this script into my archive. This bash script is straight forward and will fetch my current external ip address and compare it to the DNS entry that’s currently present.
There’s also a little bit of security, the addresses must validate. This ensures that both addresses are valid.

There’s some free DNS hosts out there, I will show the API calls for two of them. ClouDNS and Hurricane Electric Free DNS. The API calls are both supporting curl, and I’m sure other DNS hosting providers do the same.