MangoDNS MikroTik Dynamic DNS Domain

Dynamic DNS (DDNS) is a method of automatically updating a

MangoDNS MikroTik Dynamic DNS Domain

Dynamic DNS (DDNS) is a method of automatically updating a name server in the Domain Name System (DNS), often in real time, with the active DDNS configuration of its configured hostnames, addresses or other information.

The term is used to describe two different concepts. The first is "dynamic DNS updating" which refers to systems that are used to update traditional DNS records without manual editing. These mechanisms are explained in RFC 2136, and use the TSIG mechanism to provide security. The second kind of dynamic DNS permits lightweight and immediate updates often using an update client, which do not use the RFC2136 standard for updating DNS records. These clients provide a persistent addressing method for devices that change their location, configuration or IP address frequently. Source

Script Dynamic DNS Domain for MikroTik

:global ddnsuser "username"
:global ddnspass "password"
:global ddnshost "sub.domain.net"
:global ddnsip
:local resolvedIP [:resolve $ddnshost]
/tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path=ipaddress.txt
:set ddnsip [/file get [/file find name=ipaddress.txt] contents]
:log info "set ddnsip: $ddnsip"
:global str "/api/\?host=$ddnshost&ip=$ddnsip"
:if ([ :typeof $ddnsip ] = "nothing" ) do={
    :log info ("DNS: No set IP on $ddnsip, please check again")
} else={
:if ($ddnsip != $resolvedIP) do={
    :log info "DNS: Update IP $ddnsip to $ddnshost"
    :log info [ :put [/tool fetch address=admin.mangospot.net src-path=$str mode=https user=$ddnsuser password=$ddnspass dst-path=MangoSpot.txt] ]
} else={ 
    :log info "DNS: IP $ddnsip same as the previous $resolvedIP"
}
}

Video Tutorial

Related Post

Install FreeRadius MySQL on Debian or Ubuntu
Install FreeRadius PgSQL on Debian or Ubuntu
Install MariaDB on Debian or Ubuntu
Install PostgreSQL on Debian or Ubuntu

Comments

There are 0 comments on this post

Leave A Comment