I'm investigating using dnsruby to perform A record and PTR record updates. I have the A record update working from the example in the README, however I cannot find any example or other information about how to perform a PTR record update. In my example, the zone 0.0.10.in-addr.arpa exists, and functions properly with nsupdate, and a corresponding A record exists the IP 10.0.0.200. The example fails with 'Update failed: Dnsruby::TsigNotSignedResponseError'. Here is the code I have so far . . . Thans for your help.
#!/usr/bin/env ruby
require 'rubygems'
require 'dnsruby'
KEY_NAME="rndc.key"
KEY = "XXXXXXXXXXXXXXXXXXXXXX=="
res = Dnsruby::Resolver.new({:nameserver => 'my.dns.server'})
res.tsig=KEY_NAME, KEY
# Create the update packet.
update = Dnsruby::Update.new('0.0.10.in-addr.arpa')
update.absent('200.0.0.10.in-addr.arpa.', 'PTR')
# Add a PTR record.
update.add('200.0.0.10.in-addr.arpa.', 'PTR', 86400, 'foo200.example.com.')
# Send the update to the zone's primary master.
begin
reply = res.send_message(update)
print "Update succeeded\n"
rescue Exception => e
print "Update failed: #{e}\n"
end