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.
- Make sure you have a domain at Transip
- Create an access key for the API.
(Control panel > My Account > API)
- Add a label and press create.
- Save Key to a file.
e.g. privatekey.pem
- Create config file. run
go-transip-dyndns init
to create a configuration file. Example config file - Add it to the crontab
0 * * * * /usr/local/bin/go-transip-dyndns update
- run
go-transip-dyndns create
to create the record - run
go-transip-dyndns validate
to see if all is 👍 - You are set. Well done!
- For a docker install see Docker section
The key file can be loaded via two options:
- Load key from external file.
- Inject keyfile into the configuration file.
Simply put the path to the file into the private-key field.
Mind the single double quote at the beginning and end of the path.
private-key = "/some/path/to/key.file"
When you want to store the keyfile in the configuration file for ease to only have to maintain one file put the file directly behind the private-key value enclosed by three double quotes at the beginning and the end of the certificate. Ensure you don't put any spaces in the key structure to not break the key.
private-key = """-----BEGIN PRIVATE KEY-----
...Your certificate data...
...Your certificate data...
...Your certificate data...
...Your certificate data...
...Your certificate data...
...Your certificate data...
...Your certificate data...
...Your certificate data...
-----END PRIVATE KEY-----"""
These records are handy and can have more markup than just an IP. For this purpose you have the ability to completly format the record and just inject the IP addresses. This can be done to inject a ip via the tags:
- {{.IPv4}} for the IPv4 address.
- {{.IPv6}} for the IPv6 address.
Example SPF record:
v=spf1 ip4:{{.IPv4}} ip6:{{.IPv6}} include:thirdpartydomain.com -all
name: go-transip-dyndns.toml
place the config file at /etc/go-transip-dyndns.toml or in the directory where you execute the command.
[general]
#
# Enable verbose mode (debugging information).
# Disabled by default.
#
verbose = false
#
# Pull in your public IPv4 address.
#
IPv4 = true
#
# Pull in your public IPv6 address.
# Only use when you have an IPv6 address.
#
IPv6 = false
#
# Update in keep running mode every x (in minutes)
#
update-frequency = 1
[account]
#
# Your account name on transip.
#
username = "your-account name"
#
# Private key to get access the API.
# Create your own key here: https://www.transip.nl/cp/account/api/.
#
# You have two options here.
# Include the private key in the configuration file.
#
# Example:
# private-key = """-----BEGIN PRIVATE KEY-----
#...Your certificate data...
#-----END PRIVATE KEY-----"""
#
# or
#
# provide the path to the file that contains the private key.
#
# Example:
# private-key = "/path/to/key.pem"
#
# Mind the """content""" (3x) quote for including the key in the config and the "path" (1) for the path...
#
private-key = """-----BEGIN PRIVATE KEY-----
...Your certificate data...
-----END PRIVATE KEY-----"""
#
# The DNS record you want to update.
# You can have as many as you want.
#
#[[record]]
#
# the domain name where the record should be updated.
#
#hostname = "example.com"
#
# The entry key for the domain
# in this example my-home.example.com is the full dns entry we are creating here.
#
# use @ if you want to redirect the root domain.
#
#entry = "my-home"
#
# The caching time in seconds.
#
#ttl = 60
#
# The record type.
# A for IPv4
# AAAA for IPv6
# but can also be MX TXT SRV
#
#type = "A"
#
# content that will be pushed into the record.
# this value is ignored for A and AAAA records.
# for other records you can use the placeholders {{.IPv4}} and {{.IPv6}}
# to inject the IP's
#
# content = ""
[[record]]
hostname = "example.com"
entry = "my-home"
ttl = 60
type = "A"
content = ""
Binaries are available for download in multiple formats
- Windows (32/64 Bit)
- Linux Intel (32/64 Bit)
- Linux ARM (32/64 Bit) - Run directly on most routers
- Linux ARM for Raspberry PI
- Linux MIPS 64 - Unifi USG
- MacOS 64 Bit
Download them here.
For easy usage I personally run it via docker-compose with a file similar to the one shown below.
version: '3.3'
services:
go-transip-dyndns:
image: jlentink/go-transip-dyndns:latest
container_name: go-transip-dyndns
volumes:
- ./go-transip-dyndns.toml:/etc/go-transip-dyndns.toml
restart: unless-stopped
Verify the setup by running the following command in the terminal where the docker-compose file is stored. It will verify the setup and output the results
docker-compose run --rm --entrypoint /usr/bin/go-transip-dyndns go-transip-dyndns -v validate
To create the initial records run:
docker-compose run --rm --entrypoint /usr/bin/go-transip-dyndns go-transip-dyndns -v create
Now all is created start the client as a deamon.
docker-compose up go-transip-dyndns -d
This tool has been created for me own comfort. There is no association with Transip. But I would like to thank TransIP for there fine service!
Previous version was build in PHP.
- Code clean-up
- DNS based change check (not only API)