Articles that updated a long time ago may have already lost the technical merit. Please kindly pay attention while reading.

OpenDNS has a “un-official” (I didn’t find any docs at least) API for returning your public IP, by a normal DNS query.

dig @resolver1.opendns.com -t A -4 myip.opendns.com +short