Automatically updates a domain (registered with DigitalOcean)'s record with the current IP of the machine. Ideal for home-labs with dynamic IPs who want to avoid services like NoIP or can't use cloudflare domains.
Designed for Linux
Requires: Python 3.6.9 or later, requests library installed.
Download the source code of this gist by using the download button, and extract the zip file.
Update the variables in main.py
that have capital letters. Update your domain name, record name and DigitalOcean API Key.
Make the file executable with
chmod +x main.py
Run the file with
./main.py
# OR
python3 main.py
This will only run this once. Be sure to use something like crontab
to automatically run this every once-in-a-while. Once every 30 minutes
is a good call. We don't want to spam any APIs!
Be sure to star this if it was useful!