HostOnNet Blog

Python script to update

I want to set DDNS (Dynamic DNS, that will point A record like to your dynamic IP) with, i don’t want to install their program. I found they allow making custom clients. I made a small program in Python to do the update. Here is the code

import urllib

myurl = ""

web_page = urllib.urlopen("")
myip =

print "Your IP is " + myip + "\n"

update_url = "http://" + username + ":" + password + "" + myurl + "&myip=" + myip

print update_url + "\n"

print urllib.urlopen(update_url).read()

You can run it with crontab or schedule task.

Posted in Python