Hi All, 

I have just come upon this project and feel relieved that something Pythonic 
can be used to manage DNS records normally managed by DDNS. Problem is, I can't 
see to get my rudimentary script to update a zone under my authoritative 
control, and was wondering if someone could give a hand. I am simply trying to 
update the zone with the A record for host test1.test.jeffreyforman.net to 
10.30.0.4 using the appropriate tsig key. 

Here is my script: 
#!/usr/bin/env python 

import dns.query 
import dns.tsigkeyring 
import dns.update 
import sys 

keyring = dns.tsigkeyring.from_text({ 
'ddns-key' : "xkzz5238iy/JXE/rRkFuFSKfoo" 
}) 

update = dns.update.Update('test.jeffreyforman.net.', keyring=keyring, 
keyalgorithm ="hmac-md5", keyname = "ddns-key") 
update.replace('test1', 300, 'A', sys.argv[1]) 

response = dns.query.udp(update, "10.10.0.1") 
-------------------------- 

Upon execution I get the following error: 

jfor...@monitor:~/python-ddns$ ./add_dnsrecord.py 10.30.0.4 
Traceback (most recent call last): 
File "./add_dnsrecord.py", line 15, in <module> 
response = dns.query.udp(update, "10.10.0.1") 
File "/usr/lib/pymodules/python2.6/dns/query.py", line 113, in udp 
wire = q.to_wire() 
File "/usr/lib/pymodules/python2.6/dns/update.py", line 241, in to_wire 
return super(Update, self).to_wire(origin, max_size) 
File "/usr/lib/pymodules/python2.6/dns/message.py", line 418, in to_wire 
self.keyalgorithm) 
File "/usr/lib/pymodules/python2.6/dns/renderer.py", line 286, in add_tsig 
algorithm=algorithm) 
File "/usr/lib/pymodules/python2.6/dns/tsig.py", line 88, in sign 
time_mac = struct.pack('!HIH', upper_time, lower_time, fudge) 
TypeError: unsupported operand type(s) for &: 'str' and 'long' 

I had found a posting to this list from February that seemed to have fix this 
issue in 1.8.0 (I am running 1.8.0-1 from Ubuntu 10.10) but still seem to be 
encountering something similar. Anyone to point me in the right direction of 
where I've gone wrong? 

Thanks, 
Jeff 
_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users

Reply via email to