Skip to content

Simple Python script to update the DNS record on DigitalOcean with the current external IP address of a server behind NAT

Notifications You must be signed in to change notification settings

7opf/digitalocean-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DigitalOcean DDNS script

Fetches the externally visible IP address of a server behind NAT and updates the A record for the given domain using DigitalOcean's API (v2).

Install, in the project dir

python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install requirements.txt

Make sure to set environment variables and run with python 3

. venv/bin/activate
export DO_API_TOKEN=<token>
export DOMAIN=sub.domain.tld
export IP_SERVICES=https://api.ipify.org,https://ident.me
python3 do-ddns

IP_SERVICES accepts a comma-separated list of URLs that return the IP in plain text

About

Simple Python script to update the DNS record on DigitalOcean with the current external IP address of a server behind NAT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages