Dynamic DNS Update Script for No-IP DNS behind NAT (ver 1)

in #network8 years ago (edited)
  1. Paste the source code that appears below. Edit the user, password, hostname and interface info to match your setup.

update noip ddns

   :local noipuser username
   :local noippass password
   :local host noiphost
   :local inetinterface ether1-gateway
   :global previousIP
   /tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
   :local result [/file get dyndns.checkip.html contents]
   :local resultLen [:len $result]
   :local startLoc [:find $result ": " -1]
   :set startLoc ($startLoc + 2)
   :local endLoc [:find $result "</body>" -1]
   :local currentIP [:pick $result $startLoc $endLoc]
   :local filename ("no-ip_ddns_update-" . $host . ".txt")
   :if ([/interface get $inetinterface value-name=running]) do={
       :if ($currentIP != $previousIP) do={
           :set previousIP $currentIP
           :local url "http://dynupdate.no-ip.com/nic/update\3Fmyip=$currentIP"
           /tool fetch url=($url . "&hostname=$host") user=$noipuser password=$noippass mode=http dst-path=$filename
       } else={
          :log info "No-IP: Previous IP $previousIP is equal to current IP, no update needed"
       }
   } else={
          :log info "No-IP: $inetinterface is not currently running, so therefore will not update."
   }
Sort:  

Congratulations @dinh! You received a personal award!

1 Year on Steemit

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @dinh! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.099
BTC 64757.06
ETH 1876.27
USDT 1.00
SBD 0.38