This repository contains a Python script for automatically updating DNS records for GoDaddy® domains. The script is ideal for users with dynamic IP addresses who wish to keep their DNS records in sync without manual intervention. There are two versions of the script:
Designed to be run at regular intervals using a scheduler like cron on Linux or Task Scheduler on Windows. (Ideal for machines with limited CPU cores)
Runs in a continuous loop (through terminal), checking and updating the DNS record if the public IP address changes.
NOTE: Both are the same code, just different use cases.
- Python 3 installed on your system.
- A GoDaddy® account and API credentials (API key and secret).
git clone https://github.com/smalkasian/GoDaddy-Dynamic-DNS.git
cd GoDaddy-Dynamic-DNS
pip install requests
- Open the script using a text editor or IDE.
- Locate the VARIABLES section at the top of the script.
- Replace the placeholder values for api_key, api_secret, and domain with your actual GoDaddy® API credentials and the domain you wish to update.
To run the continuous version, simply execute the script using Python:
python godaddy-dynamic-dns_V2-continuous.py
(sometimes you may need to use "python3 godaddy-dynamic-dns_V2-continuous.py")
The script will continuously check for IP address changes every 5 minutes (default setting) and update the DNS record on GoDaddy® if necessary.
The scheduled version is intended to be run at regular intervals using a task scheduler. This approach is more resource-efficient and is recommended for most users.
Open your crontab file for editing:
crontab -e
Add a line to schedule the script to run at your desired interval. For example, to run every hour:
0 * * * * /usr/bin/python /ADD/PATH/TO/godaddy-dynamic-dns_V1-scheduled.py
NOTE: Make sure to add the proper path to the file
Save and close the crontab.
- Open Task Scheduler and create a new task.
- Set the trigger to your desired interval (e.g., every hour).
- For the action, start the program with the script's path as the argument.
GoDaddy® is a registered trademark of GoDaddy Operating Company, LLC. This project is not affiliated with, endorsed by, or sponsored by GoDaddy Operating Company, LLC.