Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.
/ digitalocean-ddns Public archive

A script to use DigitalOcean as a DDNS service.

License

Notifications You must be signed in to change notification settings

BetaHuhn/digitalocean-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

digitalocean-ddns

A script to use DigitalOcean as a DDNS service.

Prerequisites

If your domain is hosted on DigitalOcean you can use this script to update the address of an A record as if DigitalOcean was a DDNS service.

You have to have an A record setup on your DigitalOcean DNS like this:

pc.example.com.   3600  IN  A  172.27.171.106

Then can use this shell script to periodically update that DNS record with your current external IP address. So you could set this up on your PC at home and always have access to it via pc.example.com or something. Just like a normal DDNS service.

Setup

Clone this repository Get your api token here and your dns record via this command:

curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer YOUR API TOKEN" "https://api.digitalocean.com/v2/domains/YOUR DOMAIN/records"

and paste them into the update_ip.sh file aswell as your domain.

API_TOKEN="F00B4R" #your api token
DOMAIN="foo.bar" #your domain
ID=123456 #your dns record id

Change permissions of the update_ip.sh file:

chmod +x update_ip.sh

Edit your crontab with:

crontab -e

and add:

*/30 * * * * /path/to/the/file/update_ip.sh

Author

Maximilian Schiller - author - BetaHuhn

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Releases

No releases published

Packages

No packages published

Languages