GoDaddy offers a developer API now that I have used to write the python script that you can get at my Bitbucket Repository
Since I am unable to post a link I will post the python code...
import json
import pif
import requests
# user defined - START
key = 'YOUR_GODADDY_KEY_GOES_HERE'
secret = 'YOUR_GODADDY_SECRET_GOES_HERE'
requestDomain = 'YOUR_GODADDY_DOMAIN_HERE' # ex) notreal.com
# user defined - END
# static - START
rootUrl = 'NOT_ALLOWED_TO_POST_URL_ON_THIS_FORUM'
recordType = 'A'
recordName = '@'
requestUrl = "%s/v1/domains/%s/records/%s/%s" % (rootUrl, requestDomain, recordType, recordName)
requestHeaders = {
'Content-Type': 'application/json',
'Authorization': ("sso-key %s:%s" % (key, secret))
}
# static - END
public_ip = pif.get_public_ip()
records = requests.get(
requestUrl,
headers=requestHeaders
).json()
if records[0]['data'] != public_ip:
print "UPDATING TO %s" % (public_ip)
records[0]['data'] = public_ip
requests.put(
requestUrl,
data=json.dumps(records),
headers=requestHeaders
)
else:
print "%s IS UP TO DATE" % (public_ip)
The script simply updates the aRecord of your domain to point to your IP if it doesn't already. At this time it is a python script that can be run manually or executed inside a cron job to keep your IP address synced up with your domain name.
Things you need to do
- Register for a developer account at GoDaddy (I would post the link but this forum doesn't allow me to post one)
- Generate an API key and secret for your developer account
- Ensure your system has python installed
- Install the python dependencies listed in the README of the repository
pip install json && pip install pif && pip install requests
Run the script as needed or create a cron job to run the script on a schedule
I hope this helps you, it works for me with my non static IP address and GoDaddy domain name.
Enjoy!