Loopia DDNS in dd-wrt

There’s a few posts all over the internet when you try to find information about how to use DDNS in dd-wrt
with Loopia as your DNS provider. I found this post in one of the forums by “Codetracer” (Thanks!) pointing me in the right direction although didn’t manage to get it to work at first and the reason for that was that my build 16994 had a broken Inadyn daemon. Updated to 18024 and all worked fine.

For this to work your WAN interface needs to be your external interface and have your external
IP as we fetch that information from NVRAM. In other cases you need to fetch this information
using a external page (Example below).

Do the following (Copy paste from the forum):

– DDNS Service can be disabled. At least thats how I do it.

– Add your info to the code. Change *USERNAME*, *PASSWORD*, *FQDN_HOST_NAME* (zzz.yyy.com)
Where username usually is your primary domain

– Open DD-WRT web interface and go to “Administration” –> “Commands”

– Paste code in “Command Shell” and make sure the string is

– Click “Save Startup”

– Reboot router.

– Done!

– Check /tmp/ddns/ddns.log for messages about last update.

#DDNS(inadyn) for Loopia
sleep 10
mkdir /opt/tmp/ddns 
/usr/sbin/inadyn -u *USERNAME* -p *PASSWORD* --background --dyndns_system \
custom@http_svr_basic_auth -a *FQDN_HOST_NAME* --update_period_sec 600 \
--forced_update_period 864000 --log_file /tmp/ddns/ddns.log --cache_dir \
/tmp/ddns --exec ddns_success --dyndns_server_name dns.loopia.se \
--dyndns_server_url /XDynDNSServer/XDynDNS.php?system=custom\&myip=$(nvram get wan_ipaddr)\&hostname=

There are a few thing worth mentioning. As cache and logs are stored i /tmp this will be cleared when
the router reboots and this will force a update of your DNS at startup. Not sure about Loopia but several
other providers simply blocks your IP for a period of time. To be on the safe side use persistent storage
for example a USB stick to store cache data and logs.

If your WAN interface isn’t you external interface and doesn’t have your external ip (you are on LAN) add the following option to fetch the public IP

--ip_server_name dns.loopia.se/checkip/checkip.php

Over and out!


7 thoughts on “Loopia DDNS in dd-wrt”

  1. Is the option –ip_server_name really used if we’re pulling the IP address from “nvram get wan_ipaddr” anyway? Is the public IP in nvram updated by inadyn?

    By the way, a small typo, the command has to be “–ip_server_name dns.loopia.se /checkip/checkip.php” (note the double dash and the space after the FQDN).

    1. Just figured out how you can use the DD-WRT DDNS service (no custom script):

      DDNS Service: Custom
      DYNDNS Server: dns.loopia.se
      User Name:
      Host Name:
      URL: /XDynDNSServer/XDynDNS.php?
      Additional DDNS options: –dyndns_system custom@dyndns.org –ip_server_name dns.loopia.se /checkip/checkip.php

      The only downside is that it adds an MX record under Host Name set to , but that doesn’t really matter if you are only updating subdomains.

      1. And i will test this also when a stable build for my router is available 🙂 Not using dd-wrt at the moment, well not as firewall anyway but only as a repeater bridge for wifi coverage. Using Asuswrt Merlin build on a RT-N66U which has a slightly different setup for inadyn but works (unless you upgrade and forget to backup jffs-storage for custom scripts…). Although recent reports of vulnerabilities in Asuswrt official firmware makes me want to go back to dd-wrt…

      2. Shouldn’t it be as simple as to add -a your.fqdn.name to Additional DDNS options to only update that subdomain? Have you tried that?

    2. Hi,

      No, the -ip_server_name is not needed if you are pulling the public IP from nvram. And thanks for info about the double dash, think it’s a copy-paste issue messing with the formatting, will fix that!


  2. Have you confirmed that? i cant get loopia to update my dns that way… ddwrt say in the Webb interface that it is successful but the real dns are not updated… I need this to work…

  3. Is this script still working for you? I’ve spent the whole day trying to make it work, with no luck. Am I doing something wrong or is this script not valid anymore? I have DD-WRT v3.0-r29002 std (02/01/16).

    Could the device be an issue? It’s TP-Link TL-WR740N v4.

    Thanks in advance.

Comments are closed.