ddns.sh is a very simple script for updating A records at a DNS provider. The script is intended to be run either from cron, ifupdown, or some other network dispatcher service.
The current IP address is determined based on the value of the environment
Currently supported DNS providers:
It should be relatively easy to add support for other providers that have REST APIs, or other APIs that aren't too terrible to use from from the shell.
I found most ddns updater things to be too complicated.
ddns.sh <path to configuration file>
ddns.sh uses the
IP_ADDRESS environment variable to determine what IP address
to use for validating and configuring the DNS provider.
Running this as root is not required.
More examples of running this:
# Using an external service to get the IP: $ IP_ADDRESS="$(curl ifconfig.me)" ddns.sh ~/.config/ddns.sh/config
ddns.sh expects a flat configuration file with the following keys:
PROVIDER="luadns" KEY="aaaaabbbccccccddddd1111222222" EMAIL="firstname.lastname@example.org" DOMAIN="foo.com" TTL="60"
The keys are explained below.
DNS provider, valid options:
Key or passphrase used for authenticating with the DNS provider.
Email or username to use for authenticating with the DNS provider.
Domain to validate and update A records for at the provider.
TTL, in seconds, to configure when updating A records, when an IP address update is required.
Defaults to 60 seconds. Why? Because I don't want to wait around for DDNS updates to happen.