DNS-O-Matic auto update this work with microtik 5.26

:global previousIP

:log error "DNS-O-Matic IP: last IP $previousIP"

get the current IP address from the internet (in case of double-nat)

/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:local result [/file get dyndns.checkip.html contents]

parse the current IP result

:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "" -1]
:global currentIP [:pick $result $startLoc $endLoc]



:if ($currentIP != $previousIP) do={

:log warning "DNS-O-Matic IP: new IP $currentIP"

:log warning "Open Dns IP : update now"

:set previousIP $currentIP

:local maticuser "username"
:local maticpass "password"
:local host "http://updates.dnsomatic.com/nic/update"

/tool fetch url=$host user=$maticuser password=$maticpass mode=http


} else={
:log error "DNS-O-Matic IP: no need to update"
}

I’m trying to run your script.

But when I run it I get the next error
status: failed

failure: closing connection: 216.146.38.70:80 (4)

May be you can help me? Any idea why I getting this error?
Thanks!

} else={
:log error “DNS-O-Matic IP: no need to update”
}

How many wan lines do you have ?
Do you use the wan integration lines ?

I don’t have much experience with networks…
This is the answer of /interface print
0 R ether1 ether 1500 1600 9500 D4:CA:6D:E8:58:81
1 ether2 ether 1500 1600 9500 D4:CA:6D:E8:58:82
2 R ether3 ether 1496 1500 9116 D4:CA:6D:E8:58:83
3 R Data vlan 1500 1496 D4:CA:6D:E8:58:83
4 R Guests vlan 1500 1496 D4:CA:6D:E8:58:83
5 R Service vlan 1500 1496 D4:CA:6D:E8:58:83
6 R VoIP vlan 1500 1496 D4:CA:6D:E8:58:83
7 R pptp-RN pptp-out 1300

I didn’t make the network. I’m just trying to administrate it.

which one of these lines connects microtik server to the Internet

First of all, thanks for your help!
The line is ether1

I think you have already guess, but I think that the problem is with the tool fetch command. I have tried with different very simples (from the mikrotik fetch wiki) examples and I receive the same error.
Something wrong with my configuration, but don’t know where to start.

I’m sorry i cant help you Because Lack of my experience
and you will find some one Professional More than me to give help to you
im sorry about my english

Replace this:

# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:local result [/file get dyndns.checkip.html contents]

# parse the current IP result
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "</body>" -1]
:global currentIP [:pick $result $startLoc $endLoc]

To this:

:global currentIP [:resolve myip.opendns.com server=208.67.222.222];