Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS replace records by criteria #298

Closed
blowmage opened this issue Sep 9, 2015 · 12 comments
Closed

DNS replace records by criteria #298

blowmage opened this issue Sep 9, 2015 · 12 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Milestone

Comments

@blowmage
Copy link
Contributor

blowmage commented Sep 9, 2015

Instead of specifying the records that need to be deleted, allow users to specify the types of records to be removed and replaced.

zone.replace "NS", [new_ns_record1, new_ns_record2]

Update: The example code should be:

zone.replace "example.net"., "A", 18600, ["127.0.0.1"]

See the discussion below about this.

@blowmage blowmage added the dns label Sep 9, 2015
@blowmage blowmage added this to the 0.4.0 - DNS milestone Sep 9, 2015
@jgeewax
Copy link

jgeewax commented Sep 10, 2015

Definitely have a look at what we did on gcloud-node for this, it was a bit
of a discussion IIRC

@blowmage
Copy link
Contributor Author

@jgeewax is that discussion somewhere we can see it? I didn't find many DNS issues on gcloud-node. But I may be poor at searching for it...

@jgeewax
Copy link

jgeewax commented Sep 10, 2015

@stephenplusplus - do you recall where we had the debate about replacing
records in cloud DNS?

@quartzmo
Copy link
Member

There is some discussion here: googleapis/google-cloud-node#706.

Specifically, here: googleapis/google-cloud-node#706 (diff)

@quartzmo
Copy link
Member

@jgeewax Is this likely to be the concern you meant to point us to?

is it possible that not all of the records would be returned via getRecords and there would be additional records via nextQuery?

In that case, point taken: Be sure to fetch all matching records before making the call to replace.

@stephenplusplus
Copy link

I don't think there was much of a discussion about it. I just did it and you said something like "this is cool, just make sure you mention it's not atomic."

Here it is: googleapis/google-cloud-node#706 (comment)

@quartzmo
Copy link
Member

Thanks @stephenplusplus

@blowmage blowmage self-assigned this Sep 14, 2015
@blowmage
Copy link
Contributor Author

@stephenplusplus @callmehiphop Hey guys, can you give us some background on the use case for replace() removing all records by type? What user problem is it solving?

@stephenplusplus
Copy link

My only direct experience with records has been pretty simplistic: updating the nameservers for my domains. When I was playing with the API while developing, I wanted to see how easy that would be, which is how I ended up with removing the records by type. Was it a bad idea?

@blowmage
Copy link
Contributor Author

No, not at all! :) We were just curious where it came from. We are thinking about an option to auto-update the SOA record when changes are made, and we were curious where replace() came from. In order to auto-update SOA we will need to grab all records like replace() does. Thanks for the info!

@blowmage
Copy link
Contributor Author

I've spent a fair amount of time looking into managing DNS records and how Google Cloud DNS behaves. My thinking has changed from the time this issue was first created. Google Cloud DNS does not allow multiple records to exist for a name/type combination, so replace can simply take the 4 records values, check if a record already exists, and them perform the add/remove. So the method signature would match the Zone#record signature:

zone.replace "example.net.", "A", 18600, ["127.0.0.1"]

@blowmage
Copy link
Contributor Author

Our intention is to allow multiple replacement calls within a single change request using Zone#update when passing a block:

zone.update do
  replace "example.net.", "A", 18600, ["127.0.0.1"]
  replace "www.example.net.", "A", 18600, ["127.0.0.1"]
  replace "mail.example.net.", "A", 18600, ["127.0.0.1"]
  replace "example.net.", "MX", 18600, ["10 mail.example.net",
                                        "20 mail.example.com"]
end

blowmage added a commit to blowmage/google-cloud-ruby that referenced this issue Sep 21, 2015
Replace existing record with the new record provided.

[refs googleapis#298]
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

5 participants