This is something of a "give it back" post in case anyone else is trying to use dynu for DDNS, which I did after the ASUS DDNS service stopped working. I also investigated a few of the services out there and I was looking for minimal touch (set it/forget it) as well as free. I went with dynu because they have a REST API that would let me set the IP updates from the router (and I wanted the router to perform the update rather than relying on some other computer in my house to do it as I *know* the router will be up, which I can't say for some other machine).
The solution involves:
1. Getting a free dynu DDNS account [Note: I have no affiliation with them.]
2. Creating a DDNS name in the account.
3. Generating an API key in my Dynu account
4. Creating /jffs/scripts/ddns-start
5. Setting DDNS to "Custom" in the WebUI.
The script does a couple of things:
* Grabs the IP address from eth0
* Sends an API POST to Dynu with the API string, IP address, and some account information
* Generates a "1" return code
Here's my script with certain values xx'd out:
#!/bin/sh
API="xxxxxxxxxxxxxxxxxxxx" # My Dynu DDNS API Key
IP=$(ip a s dev eth0 | grep -oP 'inet\s+\K[^/]+')
curl -X POST
https://api.dynu.com/v2/dns/yyyyyyy -H "accept: application/json" -H "API-Key: ${API}" -d "{\"name\":\"my.ddnsgeek.com\",\"group\":\"\",\"ipv4Address\":\"${IP}\",\"ttl\":90,\"ipv4\":true,\"ipv6\":false,\"ipv4WildcardAlias\":true,\"ipv6WildcardAlias\":false,\"allowZoneTransfer\":false,\"dnssec\":false}"
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi
That API variable is your API key. The "yyyyyyy" is your DDNS account DDNS id for your custom FQDN. The other value you'll need to sub out is the "name", which is "my.ddnsgeek.com" above -- use the FQDN you created. The rest of the values you'll want to check to make sure they make sense for your own setup.
Obviously this would be a 'cleaner' script if I changed the rest of the JSON values into variables and had a nice list of variable declarations up top to set them.
The Dynu API page is pretty cool; you can log into it with your own API key and then send test parameters before you commit your own curl line.
Hope this helps someone.