Script DynDns que funcione
boa tarde,
Tenho esse script para atualizar ip do dyndns:
Código :
:local username "meu user no dyndns"
:local password "minha senha"
:global hostname "host que quero usar"
:global dyndnsForce
:global previousIP
:local resolvedIP [:resolve $hostname]
#print some debug
#:log info ("UpdateDynDNS: username = $username")
#:log info ("UpdateDynDNS: password = $password")
:log info ("UpdateDynDNS: hostname = $hostname")
:log info ("UpdateDynDNS: previousIP = $previousIP")
:log info ("UpdateDynDNS: resolvedIP = $resolvedIP")
# 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]
:local currentIP [:pick $result $startLoc $endLoc]
:log info "UpdateDynDNS: currentIP = $currentIP"
# Remove the # on next line to force an update every single time - useful for debugging,
# but you could end up getting blacklisted by DynDNS!
# Edit: Not really needed anymore... the result is not equal... Update will happen.
#:set dyndnsForce true
# Determine if dyndns update is needed
# more dyndns updater request details [URL]http://www.dyndns.com/developers/specs/syntax.html[/URL]
#This is where we check the DNS record against actual result. Thanks to jimstolz76
:if (($currentIP != $resolvedIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:set previousIP $currentIP
/tool fetch user=$username password=$password mode=http address="members.dyndns.org" \
src-path="/nic/update?hostname=$hostname&myip=$currentIP" dst-path="/dyndns.txt"
:local result [/file get dyndns.txt contents]
:log info ("UpdateDynDNS: Dyndns update needed")
:log info ("Update Result: " . $result)
:put ("Dyndns Update Result: " . $result)
} else= {
:log info ("UpdateDynDNS: No dyndns update needed")
}
Funciona 100% no mikrotik versao 5xx, mas na versão 6.34 não roda nem a pau, alguém teria um que funcione para me passar?
grato:
Re: Script DynDns que funcione
Se for RB VC pode usar o ddns da mikrotik (ip cloud)
Enviado de meu GT-I9070 usando Tapatalk
Re: Script DynDns que funcione
boa tarde,
o problema que o cliente quer usar o host do dyndns por causa do nome.
Re: Script DynDns que funcione
/tool DNS update
Enviado de meu XT1033 usando Tapatalk
Re: Script DynDns que funcione
bom dia,
não consegui rodar esse comando DNS update,
Re: Script DynDns que funcione
no meu nano o no-ip não funciona
Re: Script DynDns que funcione
então manda seu cliente instalar o ddns dele no computador dele e pronto rsrs!!!
Re: Script DynDns que funcione
Olá, amigos do fórum... existe algum script que funcione em versões do mikrotik 5.x com DDNS do Change IP ou No-IP?
Abraço.
Re: Script DynDns que funcione
tem no wiki da mikrotik os scripts
Enviado via SM-G530BT usando UnderLinux App
Re: Script DynDns que funcione
Cara faça o seguinte use o IP > Cloud e depois crie um redirecionamento em algum DNS seu ou da empresa, caso não tenha nenhum crie um seu (ou da sua empresa) .tk que é gratuito e use ele para isso dai, só criar um registro CNAME como empresa.minhaempresa.tk e pronto. =) http://www.dot.tk/pt/faq.html