我正在尝试使用dnsruby库添加TXT记录。什么是最好的实施?
下面是我正在尝试的示例代码。
require 'dnsruby'
key = "mydns key"
resolver = Dnsruby::Resolver.new("dnsserverip")
update = Dnsruby::Update.new("zonename")
resolver.tsig = "update.zone", key, 'hmac-sha512'
update.add("domain.com", "TXT", 300, "This my txt content")
response = resolver.send_message(update)
puts response.answer