Community discussions

MikroTik App
 
savage
Forum Guru
Forum Guru
Topic Author
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

DynDNS

Tue Jan 24, 2006 3:49 pm

Lo all,

Uhm... Quick and easy...

Can someone dump a simple script for DynDNS updates n 2.9.x?? Kinda need it semi urgently if it's not to much trouble. May be good to put things like this in the WIKI as well.

Thanks,
Chris.
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Tue Jan 24, 2006 8:27 pm

:log info "DDNS: Begin"

:global ddns-user "YOURUSERID"
:global ddns-pass "YOURPASSWORD"
:global ddns-host "*1"
:global ddns-interface "EXACTINTERFACENAME"

:global ddns-system ("mt-" . [/system package get [/system package find name=system] version] )

:global ddns-ip [ /ip address get [/ip address find interface=$ddns-interface] address ]

:if ([ :typeof $ddns-lastip ] = nil ) do={ :global ddns-lastip 0.0.0.0/0 }

:if ([ :typeof $ddns-ip ] = nil ) do={

  :log info ("DDNS: No ip address present on " . $ddns-interface . ", please check.")

} else={

  :if ($ddns-ip != $ddns-lastip) do={

    :log info "DDNS: Sending UPDATE!"
    :log info [ /tool dns-update name=$ddns-host address=[:pick $ddns-ip 0 [:find $ddns-ip "/"] ] key-name=$ddns-user key=$ddns-pass ]
    :global ddns-lastip $ddns-ip

  } else={ 

    :log info "DDNS: No change" 

  }

}

:log info "DDNS: End" 


Will post in wiki now...

Who is online

Users browsing this forum: khsin0127 and 50 guests