Hi,
Can anyone share script for dnsexit behind nat?I am upgraded my hap lite to v 6.30.2 and now my old script which one I find in this forum no work with this version.Always when I run it the log say dnsexit no need to update but I am shure that IP is changed.
Hi,
it looks you are using my modification of original dynnds script I have published somewhere some time ago.
As the time went this is what I am using now and what works fine for me in 6.30.1:
# Set needed variables
:local username "name"
:local password "pass"
:local hostname "myname.domanin.tld"
:global dyndnsForce
:global previousIP
#:global currentIP
# print some debug info
#:log info ("UpdateDnsExit: username = $username")
#:log info ("UpdateDnsExit: password = $password")
#:log info ("UpdateDnsExit: hostname = $hostname")
#:log info ("UpdateDnsExit: previousIP = $previousIP")
# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="api.ipify.org" src-path="/" dst-path="disk1/dnsexit.tmp" port=80 host=api.ipify.org
:delay 2s
:local result [/file get [/file find name=disk1/dnsexit.tmp] contents]
# parse the current IP result
:local resultLen [:len $result]
:global currentIP [:pick $result 0 ($resultLen-0)]
#:log info "UpdateDnsExit: result =$result"
#:log info "UpdateDnsExit: 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 DnsExit!
#:set dyndnsForce true
# Determine if dyndns update is needed
# more dyndns updater request details on DnsExit.com
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:log info "UpdateDnsExit: Current IP $currentIP"
:log info "UpdateDnsExit: Previous IP $previousIP"
:set previousIP $currentIP
/tool fetch mode=http address="www.dnsexit.com" \
src-path="RemoteUpdate.sv?login=$username&password=$password&host=$hostname&myip=$currentIP" \
dst-path="disk1/dnsexit.txt" port=80 host=www.dnsexit.com
:local result [/file get disk1/dnsexit.txt contents]
:log info "UpdateDnsExit: previousIP = $previousIP"
:log info ("DnsExit: DnsExit update needed")
:log info ("UpdateDnsExit: DnsExit Update Result: ".$result)
:log info ("DnsExit Update Result: ".$result)
} else={
:log info ("UpdateDnsExit: No DnsExit update needed")
}
This script works almost all the time fine but I noticed one problem when the electricity is interrupted (power cuts) and when power come back the script not update dns.If I reboot the router the script works fine but if the power cuts the router is not updated.
this is very useful it works nicely
but it needs http://www.dnsexit.com subscription
i need any free way
is it possible that mikrotik sends me the content of dnsexit.tmp
every time it gets changed to my email
i think it is doable but dont know what is the appropriate script would be more than happy if u can help me with the script
Hi,
Today I am update my hab lite to 6.41 (Current) version and this script not work anymore.I can see in log message :UpdateDnsExit: No DnsExit update needed but this is
not true.If I ping to my hostname I see some other IP then the current IP is.I try also to update via web browser to put this url :http://update.dnsexit.com/RemoteUpdate.sv?login=login&password=password&host=my.host.name&myip=xxx.xx.xx.xxx
and it’s working.Can anyone help me with working script for dnsexit?