Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # gem install dnsimple-ruby
- # $ <SPACE>PASSWORD="your password" EMAIL="your e-mail" ruby dnsimple_backup.rb > dnsimple_backup.yml
- # when you put a space before running a command you prevent it from being added to the history.
- require "dnsimple"
- require "yaml"
- DNSimple::Client.username = ENV.fetch("EMAIL")
- DNSimple::Client.password = ENV.fetch("PASSWORD")
- domains = {}
- DNSimple::Domain.all.each do |domain|
- domains[domain.name] ||= []
- records = domains[domain.name]
- DNSimple::Record.all(domain).each do |record|
- records << {
- :name => record.name,
- :type => record.record_type,
- :content => record.content,
- :priority => record.prio,
- :ttl => record.ttl
- }
- end
- end
- puts domains.to_yaml
Add Comment
Please, Sign In to add comment