Friday, 26 November 2010

Dynamic DNS for EC2

I have just had to setup dynamic DNS for one of our test EC2 instances. We use DNS Made Easy for our DNS who allow dynamic DNS updates. Once I had setup the record in their systems a very quick groovy script was all I needed:

def ip = getPublicIP()
def id = "[recordID]"
def username = "username"
def password = "password"

def url = "${username}&password=${password}&id=${id}&ip=${ip}"
def result = url.toURL().text
println result

def getPublicIP(){

No comments: