Using No-IP DDNS without using DUC in Mikrotik
Way to update No-IP DDNS without running the DUC (Dynamic Update Client) software on a computer.Using built-in router setting or script based solutions is often preferred for 24/7 reliability.
For a MikroTik router, the way to handle this without using the No-IP DUC software: a native script (best for No-IP users).
- Open WinBox and go to System > Scripts.
- Click + and name it
no-ip_update. - Paste this code (replacing the placeholders with your info):
1. Using a No-IP Script (Native RouterOS Method)
Since MikroTik doesn't have a simple "No-IP" checkbox in most versions, you use a script to tell the router to update your IP.
Step A: Create the Script
===========================================
:local noipuser "YOUR_EMAIL_OR_USERNAME"
:local noippass "YOUR_PASSWORD"
:local noiphost "YOUR_HOSTNAME.ddns.net"
:local cIP [/ip cloud get public-address]
:if ([:resolve $noiphost] != $cIP) do={
/tool fetch url="http://$noipuser:$noippass@dynupdate.no-ip.com/nic/update\3Fhostname=$noiphost&myip=$cIP" keep-result=no
:log info "No-IP: Hostname updated to $cIP"
} else={
:log info "No-IP: No update needed"
}
===========================================
- Click Apply and OK.
Step B: Schedule the Script
- Go to System > Scheduler.
- Click + and name it
check_no-ip. - Set Interval to
00:05:00(runs every 5 minutes). - In On Event, type:
no-ip_update. - Click OK.
How to verify my script running ok?
1. Check the System Log
This is the most direct way to see what the script is doing. If you used the
:log info commands in your script, follow these steps:- Open WinBox and go to Log on the left menu.
- Look for entries starting with "No-IP:".
- Success: "No-IP: Hostname updated to [Your-IP]" or "No-IP: No update needed".
- Failure: You may see errors like "executing script failed" or "fetch failed".
2. Monitor Run Counts
You can verify if the Scheduler is actually triggering the script:
- Go to System > Scheduler.
- Find your
check_no-iptask. - Check the Run Count column. If it increases every 5 minutes (or whatever interval you set), the trigger is working.
- Check the Next Run column to see when it will execute again.
3.Check the "Environment" Variables
If your script uses global variables (like
previousIP), you can see their current values:- Go to System > Scripts and click the Environment tab.
- This will show you the exact IP address the router currently "thinks" it has registered with No-IP.
4. Perform a Manual Test
You can "force" a run to see if it works right now without waiting for the timer:
- Go to System > Scripts.
- Select your
no-ip_updatescript and click Run Script. - Immediately check your Log window to see the output.
5.Verify on No-IP Website
The ultimate "truth" is on the No-IP side:
- Check the "Last Update" timestamp and the "IP Address" for your hostname. They should match your router's current public IP.
Comments
Post a Comment