Skip to content

Instantly share code, notes, and snippets.

@chirauki
Created October 3, 2016 08:35
Show Gist options
  • Save chirauki/a69dac6def9b641fd5540debfd89e533 to your computer and use it in GitHub Desktop.
Save chirauki/a69dac6def9b641fd5540debfd89e533 to your computer and use it in GitHub Desktop.
DNS ruby
rname = 'test.example.com'
key_name = 'challenge-key'
key = 'ECNx9woMslMkzn5t+eR8HBLULUGh7GQ2N9N5RumbzOUKudg=='
update = Dnsruby::Update.new('example.com')
update.absent('foo.example.com.', 'A')
update.add('foo.example.com.', 'A', 86400, '10.1.2.3')
res.tsig=key_name,key
res.send_message(update)
res = Dnsruby::Resolver.new({:nameserver => 'xx.xx.xx.xx'})
update = Dnsruby::Update.new('example.com')
update.present(rname)
update.delete(rname)
res.tsig=key_name,key
res.send_message(update)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment