Python Forum
dnspython update dns record issue
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dnspython update dns record issue
#1


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.
Reply
#2
http://www.dnspython.org/examples.html Wrote:
import dns.query
import dns.tsigkeyring
import dns.update
import sys

keyring = dns.tsigkeyring.from_text({
    'host-example.' : 'XXXXXXXXXXXXXXXXXXXXXX=='
})

update = dns.update.Update('dyn.test.example', keyring=keyring)
update.replace('host', 300, 'a', sys.argv[1])

response = dns.query.tcp(update, '10.0.0.1')

Why is your key ring's value "keyname", instead of "host-example." like in the example? I'm not sure what the lib is supposed to do, so I don't know if those values are valid or not...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Last record in file doesn't write to newline gonksoup 3 420 Jan-22-2024, 12:56 PM
Last Post: deanhystad
  How do I stream and record at the same time with arducam? traderjoe 0 462 Oct-23-2023, 12:01 AM
Last Post: traderjoe
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 2,681 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  Only getting last record saved...Why Milfredo 10 4,377 Sep-10-2020, 03:00 AM
Last Post: Milfredo
  how can we record a video file from our program output (moving object) Zhaleh 0 1,811 Aug-03-2020, 02:47 PM
Last Post: Zhaleh
  Get the record number of a dBASE dbf file DarkCoder2020 0 1,770 Jun-16-2020, 05:11 PM
Last Post: DarkCoder2020
  Compare 5 variables in a record with an excel sheet!! SEED 1 1,815 Apr-20-2020, 11:10 PM
Last Post: michael1789
  How to insert record into MySQL using Phython abhay_kala 1 2,268 Dec-06-2019, 04:34 PM
Last Post: abhay_kala
  fastest way to record values between quotes paul18fr 5 3,296 Apr-15-2019, 01:51 PM
Last Post: snippsat
  Print multiple record lines ntigner 3 3,423 Feb-08-2018, 05:34 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020