Dynamic DNS script


I use Porkbun as my domain provider and I wanted to use their API for dynamic DNS.

Their API is supported by ddclient but I didn't see ddclient for OpenWRT. It's a Perl script, so if I install Perl, I might be able to get it to work. Has anyone tried it?

I decided to try writing a script myself. Here is what I came up with:

I'm publishing it online in case it's useful for anyone else.

Please consider replacing jq with jsonfilter.

Sure. What is the advantage?

It is pre-installed, it is a part of base-files.


I updated the scripts. jq is no longer required. I also added some caching to help minimize the hits needed on the host.

1 Like

Great! You can also use jsonfilter for "Get the WAN address" as shown in its help:

== Examples ==

  Display the first IPv4 address on lan:
  # ifstatus lan | jsonfilter -e '@["ipv4-address"][0].address'

Yet another way: (ip route get | awk '{print $7}') it's what I use in my own ddns script