Do not follow this link

~craftyguy/ddns.sh

a super simple ddns updater
Fix gojq test/condition
Support standard jq, but use gojq if available

clone

read-only
https://git.sr.ht/~craftyguy/ddns.sh
read/write
git@git.sr.ht:~craftyguy/ddns.sh

You can also use your local clone with git send-email.

#ddns.sh

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 variable IP_ADDRESS.

Currently supported DNS providers:

  • LuaDNS

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.

#Why???

I found most ddns updater things to be too complicated.

#Running

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

#Configuration

ddns.sh expects a flat configuration file with the following keys:

PROVIDER="luadns"
KEY="aaaaabbbccccccddddd1111222222"
EMAIL="me@example.email"
DOMAIN="foo.com"
TTL="60"

The keys are explained below.

#PROVIDER

DNS provider, valid options: luadns

#KEY

Key or passphrase used for authenticating with the DNS provider.

#EMAIL

Email or username to use for authenticating with the DNS provider.

#DOMAIN

Domain to validate and update A records for at the provider.

#TTL

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.

Do not follow this link