This is a set of scripts. Each script updates specific dynamic DNS service using current public IP.
- Mikrotik device running RouterOS 6.49.7. RouterOS 7 compatibility is not tested yet.
- Download, clone or copy script on your local computer.
- Fill "Variables" section.
- Place script in Mikrotik device using Winbox, WebFig or terminal.
- Give "read", "write" and "test" permissions.
- You can automate execution using RouterOS scheduler. See below.
You can run the script manually using Winbox or WebFig under System > Scripts section. Don't forget proper permissions.
You can also run it from terminal:
/system script run MikroTikDDNSUpdater
- DDNSService (integer) variable lets you select dynamic DNS service. Note that different services requires different types of credentials.
- Service 1: DNS-O-Matic. Requires DDNSUserName and DDNSUserPassword.
- Service 2: No-IP. Requires DDNSUserName and DDNSUserPassword.
- PublicIPServiceMode (integer) variable lets you select method of determining current public IP address:
- Method 1 uses icanhazip.com service.
- Method 2 uses Amazon Web Services service.
- Method 3 uses DNS-O-Matic service.
- Method 9 uses Mikrotik Cloud service. Requires MikroTikCloudHostName.
- VerboseMode variable (boolean) lets you activate verbose mode.
- RequestWait variable (integer) lets you define HTTP requests wait time (in seconds). Raise if network is slow.
Script uses system log to show execution results and errors. Script has 4 stages:
- Variable check: looks for defaults.
- Get public IP address.
- Get domain IP address.
- IP addresses comparison and DDNS API call.
You can automate execution in order to set and forget the script. You can do that by using RouterOS scheduler under System > Scheduler section. Don't forget proper permissions.
- lolost - sleepingcoconut.com
This project is licensed under the Zero Clause BSD license.