Mar-02-2017, 06:14 PM
I'm trying to use dnspython to do a TSIG based dynamic DNS update.
I've followed the example code :
#!/usr/bin/env python import sys import dns.update import dns.query import dns.tsigkeyring keyring = dns.tsigkeyring.from_text({ 'keyname.' : 'VarFF=2Xts7T5Vb/xd&8ir==' }) update = dns.update.Update('domain_name', keyring=keyring) update.replace('myserver', 30, 'a', '88.88.88.88') response = dns.query.tcp(update, 'dns_ip',timeout=10)
and here is what I got:
response = dns.query.tcp(update, 'dns_ip',timeout=10) File "/root/bck/dnspython/dns/query.py", line 475, in tcp q.keyring, q.mac) File "/root/bck/dnspython/dns/query.py", line 412, in receive_tcp one_rr_per_rrset=one_rr_per_rrset) File "/root/bck/dnspython/dns/message.py", line 821, in from_wire reader.read() File "/root/bck/dnspython/dns/message.py", line 749, in read self._get_section(self.message.additional, adcount) File "/root/bck/dnspython/dns/message.py", line 701, in _get_section self.message.first) File "/root/bck/dnspython/dns/tsig.py", line 198, in validate raise BadSignature dns.tsig.BadSignature: The TSIG signature fails to verify.