How to update DNS record

Andi Clemens andi.clemens at gmx.net
Thu Mar 1 14:40:18 EST 2007


Martin P. Hellwig wrote:

> I'll looked at the perl function you mentioned and it seems to me (but
> I'm not a pearl coder) that it uses the dynamic update procedure, which
> is explained by the RFC 2136 (Bjoern mentioned that already).
> 
> So I googled for "Python DNS dynamic update" and in the results the
> following site looked promising, http://www.dnspython.org/.
> 
> hth
> 
> --
> mph


It's working!!!
Yeah!
I don't know why I didn't get this the first time I tried dnspython, but now
its working! And it's so easy, 3 lines of code:

def make_dns_entry(pix):
     update = dns.update.Update(_DOMAIN)
     update.replace(pix.name, 3600, 'a', pix.outbound)
     response = dns.query.tcp(update, _NAMESERVER)

Thank you for all your help!

Andi



More information about the Python-list mailing list