digitalocean/droplet_kit

is it possible to get ID of a DNS record?

computalya opened this issue · 1 comments

is it possible to get ID of a DNS record?

I'm sorry that this question fell through the cracks and hope you already found your answer. Here's the answer for anyone else who comes across this:

In order to find the ID of a DNS record, you would need to list the records for a domain and iterate over them using something like:

records = client.domain_records.all(for_domain: 'example.coml')
records.each do |r|
  puts "id: #{r.id}, name: #{r.name}, type: #{r.type}, data: #{r.data}"
end