#!/usr/bin/env python
"""
Get the apparent public IP of this computer. This does not imply that the
necessary network configurations are in place to allow public access.
Raises Exceptions for anything but a 200 response.
:param service: the url to perform a GET against (should return only an IP)
:type service: str
:returns: this machine's IP as seen by a server on the Internet
:rtype: str
"""
=
return
# 'AAAA' for IPv6, 'A' for IPv4 (default)
=
=
# Get the Zone ID
=
break
# Get the DNS record
=
# Check to see if the IP has changed
=
=
=
You can then invoke it with a cron job: