Skip to content

Digital Ocean dynamic address DNS updater script for OpenWRT's ddns package

Notifications You must be signed in to change notification settings

szz/digitalocean_openwrt_ddns_updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

digitalocean openwrt ddns updater

This script might be a useful for you if you use Digital Ocean as name server and you would update your OpenWRT based hosts with dynamic IP address.

how to create a new sub domain

TOKEN='digital_ocean_auth_token'
IPV4_ADDR='ipv4_addr' 
DOMAIN='your.sub.domain.tld'

DATA='{"name":"'${DOMAIN}'","ip_address":"'$IPV4_ADDR'"}'

wget \
  -O - \
  --quiet \
  --save-header \
  --no-check-certificate \
  --method="POST" \
  --header="Content-Type: application/json" \
  --header="Authorization: Bearer ${TOKEN}" \
  --body-data=${DATA} "https://api.digitalocean.com/v2/domains"

how to determine record id

TOKEN='digital_ocean_auth_token'
DOMAIN='your.sub.domain.tld'

wget \
  -O - \
  --quiet \
  --no-check-certificate \
  --method="GET" \
  --header="Content-Type: application/json" \
  --header="Authorization: Bearer ${TOKEN}" \
  "https://api.digitalocean.com/v2/domains/${DOMAIN}/records" | jq '' | grep -B 1 '"type": "A"'
  

configuration

luci setting name config file key value
DDNS Service provider [IPv4] --custom--
Custom update-script update_script full path to updater script (eg: /root/ddns_digitalocean.sh)
Hostname/Domain domain your domain or sub domain
Username username record id of your domain or sub domain
Password auth_token your Digital Ocean authentication token

detailed info:

About

Digital Ocean dynamic address DNS updater script for OpenWRT's ddns package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages