Skip to content

No static IP from your ISP? This is the solution for an ever-changing, hard to remember IP address

License

Notifications You must be signed in to change notification settings

egbertp/dyndns-transip

Repository files navigation

dyndns-transip

workflow

Is a small little executable that will update a domain record of your choice that is hosted by TransIP. Run it via cron to keep your DNS record up to date.

This project is heavily inspired by go-transip-dyndns made by Jason Lentink. The inner working is similar. I used GoMods, updated to GoLang 1.15 and created binaries for more platforms and architectures (amongst others OpenBSD and FreeBSD).

Getting started

Configure TransIP

  1. Create a access key for the API. (Control panel > My Account > API)
  2. Add a label and press create.
  3. Save Key to a file. e.g. /etc/dyndns-transip.key

Download & install

Binaries are available for download in multiple formats

  • Windows (i386, amd64)
  • Linux (i386, amd64, armv6 arm64)
  • MacOS (amd64)
  • OpenBSD (i386, amd64, armv6 arm64)
  • FreeBSD (i386, amd64, armv6 arm64)

Download them here.

One-liner for Linux on amd64

$ curl -s https://api.github.com/repos/egbertp/dyndns-transip/releases/latest \
    |  jq -r '.assets[] | select(.browser_download_url | contains("linux_amd64")) | .browser_download_url' \
    | xargs -n 1 curl -O -sSL

Move the binary to /usr/local/bin

$ chmod +x dyndns-transip_1.0.0_linux_amd64
$ sudo mv dyndns-transip_1.0.0_linux_amd64 /usr/local/bin/.
$ sudo ln -s /usr/local/bin/dyndns-transip_1.0.0_linux_amd64 /usr/local/bin/dyndns-transip

Example config file

name: dyndns-transip.yaml

place the config file at /etc/dyndns-transip.yaml. optional, you can place the file in the directory where you execute the command.

username: "transip-username"
private-key: "/etc/dyndns-transip.key"

verbose: false

domain: "yourdomain.nl"
domain-entry: "subdomain"
domain-ttl: 60
$ chown root:wheel /etc/dyndns-transip.yaml
$ chmod 0644 /etc/dyndns-transip.yaml

Place the TransIP key in /etc/dyndns-transip.key

-----BEGIN PRIVATE KEY-----
(...........................)
-----END PRIVATE KEY-----
$ chown root:wheel /etc/dyndns-transip.key
$ chmod 0400 /etc/dyndns-transip.key

Create DNS record

$ dyndns-transip create

Update record

$ dyndns-transip

DEBUG - Log level set to debug...
DEBUG - Found IP address. (198.51.100.53)
DEBUG - Update Record..
DEBUG - IP is unchanged...
INFO - Record is up to date subdomain.yourdomain.nl with ip 198.51.100.53.

For more info: dyndns-transip help

Configure cron

$ crontab -e

Add to crontab

*/15 * * * * /usr/local/bin/dyndns-transip

No association with Transip

This tool has been created to compensate for the fact that my ISP does not provide me with a static IP address. There is no association with Transip.

Release new version

$ git tag -a v1.0.0 -m "Production release"
$ git push --follow-tags

git tag mini cheat sheet

$ git fetch --all # fetch all remote to local
$ git push --delete origin v0.8.1 # Remove tag remote
$ git tag --delete v0.8.1 # Remove tag local

Built with

A big thanks to all authors and contributors of these libraries and tools!

References

About

No static IP from your ISP? This is the solution for an ever-changing, hard to remember IP address

Resources

License

Stars

Watchers

Forks

Packages

No packages published