Found a DDNS error when working on a customer’s GL-A1300 v4.5.22 device today. The router refused to update the DDNS IP for the router (even after a factory reset). Posting this fix for any others with this problem.
Diagnosis - Router logs will display the errors:
Fri Nov 28 13:47:12 2025 authpriv.notice sudo: root : PWD=/ ; USER=root ; GROUP=nonevpn ; COMMAND=/usr/lib/gl_ddns/dynamic_dns_updater.sh -- stop
Fri Nov 28 13:47:13 2025 user.notice ddns-scripts[30371]: glddns: PID '30371' terminated by 'SIGTERM' at 2025-11-28 13:47
Fri Nov 28 13:47:14 2025 authpriv.notice sudo: root : PWD=/ ; USER=root ; GROUP=nonevpn ; COMMAND=/usr/lib/gl_ddns/dynamic_dns_updater.sh -- start
Fri Nov 28 13:47:15 2025 user.notice ddns-scripts[567]: ddns: PID '567' started at 2025-11-28 13:47
Fri Nov 28 13:47:15 2025 user.warn ddns-scripts[567]: ddns: Service section disabled! - TERMINATE
Fri Nov 28 13:47:15 2025 user.warn ddns-scripts[567]: ddns: PID '567' exit WITH ERROR '1' at 2025-11-28 13:47
Fri Nov 28 13:47:15 2025 user.notice ddns-scripts[570]: glddns: PID '570' started at 2025-11-28 13:47
Fri Nov 28 13:47:16 2025 user.warn ddns-scripts[570]: glddns: NO valid IP found
Fri Nov 28 13:47:17 2025 user.warn ddns-scripts[570]: glddns: PID '570' exit WITH ERROR '2' at 2025-11-28 13:47
The issue is the dynamic_dns_functions.sh script’s [[ ]] syntax doesn't work in busybox ash. The fix is to replace it with POSIX-compliant commands.
Just ssh into the router and run these commands via CLI:
# Create backup
cp /usr/lib/gl_ddns/dynamic_dns_functions.sh /usr/lib/gl_ddns/dynamic_dns_functions.sh.bak
# Fix line 917: Replace [[ ]] with case
sed -i '917c\ case "$update_script" in *lua*)' /usr/lib/gl_ddns/dynamic_dns_functions.sh
# Fix line 925: Replace 'else' with ';;\n*)'
sed -i '925c\ ;;\
*)' /usr/lib/gl_ddns/dynamic_dns_functions.sh
# Fix line 927: Replace 'fi' with ';;\nesac'
sed -i '928c\ ;;\
esac' /usr/lib/gl_ddns/dynamic_dns_functions.sh
# Verify the changes
echo "=== After changes ==="
sed -n '915,935p' /usr/lib/gl_ddns/dynamic_dns_functions.sh
# Restart the service
/etc/init.d/gl_ddns restart
# Watch the logs
tail -f /tmp/log/ddns/glddns.log
Finally, test the IP has updated successfully with: (replace examples with your ddns url)
$ nslookup xxxxxx.glddns.com
$ dig xxxxxx.glddns.com