This is a set of scripts. Each script updates specific dynamic DNS service using current public IP.
- Mikrotik device running RouterOS 6.49.7 and up or 7.14.3 and up. Other RouterOS versions may be compatible but have not been tested.
- 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 allows you to select a dynamic DNS service. Note that different services require different types of credentials.
- Service 1: DNS-O-Matic. Requires DDNSUserName and DDNSUserPassword.
- Service 2: No-IP. Requires DDNSUserName and DDNSUserPassword.
- PublicIPServiceMode (integer) variable allows you to select the method for determining the 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) allows you to enable verbose mode.
- RequestWait variable (integer) allows you to define the wait time for HTTP requests (in seconds). Increase this value if the network is slow.
- DisableDomainIPAddressCheck variable (boolean) allows you to disable the determination of the domain's current IP address. This is useful when the system is behind a Cloudflare proxy or a similar service.
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.