However one can greatly simplify this with a launchDaemon and a single built in OSX unix command.
First, this assumes that you have set up an account with a Dynamic DNS service. I use the free service provided by FreeDNS. One updates this simply by loading a web page URL. The act of making that page request alerts the DynamicDNS of your IP address and it updates.
Thus all we need is a LaunchDaemon that runs every hour that reloads that page. Here is an example:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>dynamic_dns_updater</string> <key>Disabled</key> <false/> <key>UserName</key> <string>nobody</string> <key>StartInterval</key> <integer>3600</integer> <key>ProgramArguments</key> <array> <string>/usr/bin/curl</string> <string>--silent</string> <string>--insecure</string> <string>https://freedns.afraid.org/dynamic/update.php?YKIJUSiikf83kfj8dhfhuee9jdjd9ejfj99fj9jslRRRT</string> </array> </dict> </plist>
You save this in the location:
/Library/LaunchDaemons/dynamic_dns_updater.plist
then load it:
sudo launchctl load /Library/LaunchDaemons/dynamic_dns_updater.plist sudo launchctl start dynamic_dns_updater
To remove it permanently:
sudo launchctl stop dynamic_dns_updater sudo launchctl unload /Library/LaunchDaemons/dynamic_dns_updater.plist rm /Library/LaunchDaemons/dynamic_dns_updater.plist
ls -laeo@ /Library/LaunchDaemons/
if you see any below the file you can then manually delete these with the xattr command. For example, if there is quarantine from the download you can get rid of it like this.
sudo xattr -d com.apple.quarantine /Library/LaunchDaemons/dynamic_dns_update.plist
[crarko adds: I don't use Dynamic DNS, so I haven't tried this. But stepping through the code makes it look safe to try if you do.]

