Google
 

Tips on an expat's digital life in Riyadh, Saudi Arabia. Nozbe

Tuesday, March 2, 2010

Updating a DynDNS address through batch file

Some of the routers have this feature inbuilt. But the latest mobily wiMax router doesn't have this feature. So I have been in search to have it even if the router doesn't support.I googled today to this page and that ended up making a batch file doing the whole thing in Windows, in a different way than described there.

To try, save the following in a batch file (say setip.bat). Replace those in italics with your values

@echo off

wget http://checkip.dyndns.org -O ip.txt

awk95 "{split($0,ar,\":\"); ip = substr(ar[2], 1,index(ar[2],\"/\") - 2); printf(\"set ip=%%s\n\",ip);}" ip.txt >sip.bat

call sip

start http://login-id:password@members.dyndns.org/nic/update?hostname=yoursite.selfip.org^&myip=%ip%^&wildcard=NOCHG^&mx=NOCHG^&backmx=NOCHG


Note:
1. DynDns.com is one site among many that gives the facility to have a web address to your machine.
2. awk95.exe is the Windows equivalent of awk in Unix/Linux etc.
3. wget.exe is to open any http/ftp pages from command line.
4. those lines without space in between are supposed to be a single line. After copying this to notepad, make that change before you try.
5. awk95 and wget is available to download if you do google them.

Would love to see your feedback, should you find it useful..

(I didn't know that DOS batch file have escape character. I just learned and it is ^)

FEEDJIT Live Traffic Feed

Speednet result with mobily connect

Speednet result with mobily connect
Speed

About Me

Surviving in Riyadh since 1993! Love to see smiling faces around and beyond! Contributing my tiny share around!