Set up DynDNS on Linux (Raspberry Pi, server, NAS)

Our script only reports when your IP changes – run by cron every 5 minutes.

2 minute read Updated 02.12.2026

Our script nxdyn.sh checks your IP every few minutes and only reports to us when it has changed (plus a short sign of life once a day). It only needs bash and curl.

Get the script

  • Right after creating a host or after Generate new key: download Linux script (pre-filled). Host, key and secret are already filled in.
  • Later: client area → DynDNS → Setup → Linux → nxdyn.sh (template). Then fill in HOST, KEY and SECRET at the top of the script yourself.

Setup

  1. Copy the file to the device, e.g. to /usr/local/bin/nxdyn.sh.
  2. Make it readable and executable for you only (it contains your secret):

``
chmod 700 /usr/local/bin/nxdyn.sh
``

  1. Test it once:

``
/usr/local/bin/nxdyn.sh
``

The answer should be good (new IP saved) or nochg (unchanged).

  1. Run every 5 minutes: open crontab -e and add this line:

``
*/5 * * * * /usr/local/bin/nxdyn.sh >/dev/null 2>&1
``

Done. Shortly after, the host shows active in the client area.

Good to know

  • IPv6: the script automatically reports this device's global IPv6, so exactly this device is reachable via IPv6. IPv4 only? Set IPV6=0 at the top of the script.
  • The script remembers the last reported IP in ~/.local/state/nxdyn/. Delete that file to force a new report.
  • Instead of our script you can use ddclient or another DynDNS2 client: protocol dyndns2, server https://nexus-servers.de without https://, SSL on, login = key, password = secret.
  • You also need to forward the required ports in your router.
Was this helpful?