ClouDNS DDNS & Mikrotik & Dual WAN

As a new RouterOS user, I was wondering if anyone can point me in the right direction WRt Dynmaic DNS

First thing I need to work out is how to update the DNS server with my current IP. I use dnsomatic, which is the same API/Script as DynDNS, or I could do it to my DNS Host, Cloudns, which can be updated with a dynamic URL they provide, or alternatively a wget command. They also give examples using perl, python, phph etc. I saw the DDNS option under /ip cloud but I/m not sure how to use that to updated dnsomatic or cloudns.

The second thing is I have a dual WAN setup so I need to update using the public IP of WAN1/ether1 interface, not WAN2/ether. I assume that’s possible, but I haven’t had any luck finding anything online.

Any tips or advice greatly appreciated.

Check out IP cloud, a built in ddns service MT provides.
Whats important is what are your intended uses of dydndns…

Yeah, I looked there first but the documentation seems to point to it only working with mikrotik’s cloud server, only if you have a paid CHR licence, and if you have dual WAN you may not get what you want.

None of which I am after hence to call to see if anyone has another solution that works with #rd Party DDNS hosts and more importantly can handle dual WAN properly.

For anyone searching for ClouDNS Dynamic DNS in the future, ClouDNS have this KB available.

Dynamic DNS configuration with MikroTik. It mentions multiple interfaces, but the instructions are a bit sparse, or just beyond me so I have dropped a note to their support. But for a single WAN instance, it seems quite easy to setup.

Got it working finally. Managed to put together a script that’s triggered by the scheduler. The script itself has bits and pieces of various other DDNS scripts I found on this forum, reddit and github. If you recognize some of the code as your own, thank you.

The script only checks the IP on the WAN interface. In my use case, this IP has always matched my public IP address so there was no need for me to go and check that first.

## Get Current selected WAN Interface IP and send ClouDNS update if changed from last check
##
## Select which WAN Interface to check
:global wanIf "wan2"
## Pull global variable value into script
:global wanIP "$wanIP"

## Get the current IP on the interface
:local nowIPmask [/ip address get [find interface="$wanIf" disabled=no] address];
## IP without netmask
:local nowIP [:pick $nowIPmask 0 ([:len $nowIPmask]-3)];

## Check if IP has changed and update ClouDNS if it has
:if ($nowIP != $wanIP) do={
    /log info "wan ip changed from $wanIP to $nowIP"
	## Set the global $wanIP variable with the new IP address
    :set wanIP $nowIP
	## Execute ClouDNS DDNS Update Script with updated $wanIP
    /tool fetch url="https://ipv4.cloudns.net/api/dynamicURL/?q=<Your ClouDNS Domain Update String Here>&ip=$wanIP" mode=https
}