Skip to content

Script for MikroTik's RouterOS for updating dynamic DNS service using current public IP.

Notifications You must be signed in to change notification settings

lolostt/MikrotikDDNSUpdater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

MikrotikDDNSUpdater

This is a set of scripts. Each script updates specific dynamic DNS service using current public IP.

Getting Started

Prerequisites

Hardware

  • Mikrotik device running RouterOS 6.49.7. RouterOS 7 compatibility is not tested yet.

Installing

  1. Download, clone or copy script on your local computer.
  2. Fill "Variables" section.
  3. Place script in Mikrotik device using Winbox, WebFig or terminal.
  4. Give "read", "write" and "test" permissions.
  5. You can automate execution using RouterOS scheduler. See below.

Usage

You can run the script manually using Winbox or WebFig under System > Scripts section. Don't forget proper permissions.

image

You can also run it from terminal:

/system script run MikroTikDDNSUpdater

Available options

  • DDNSService (integer) variable lets you select dynamic DNS service. Note that different services requires different types of credentials.
    1. Service 1: DNS-O-Matic. Requires DDNSUserName and DDNSUserPassword.
    2. Service 2: No-IP. Requires DDNSUserName and DDNSUserPassword.
  • PublicIPServiceMode (integer) variable lets you select method of determining current public IP address:
    1. Method 1 uses icanhazip.com service.
    2. Method 2 uses Amazon Web Services service.
    3. Method 3 uses DNS-O-Matic service.
    4. 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 behaviour

Script uses system log to show execution results and errors. Script has 4 stages:

  1. Variable check: looks for defaults.
  2. Get public IP address.
  3. Get domain IP address.
  4. IP addresses comparison and DDNS API call.

Automation

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.

image

Authors

License

This project is licensed under the Zero Clause BSD license.

About

Script for MikroTik's RouterOS for updating dynamic DNS service using current public IP.

Topics

Resources

Stars

Watchers

Forks