Skip to content

Add missing DNS Zone commands#38

Merged
ahwm merged 2 commits intomasterfrom
copilot/add-missing-dns-zone-commands
Jan 27, 2026
Merged

Add missing DNS Zone commands#38
ahwm merged 2 commits intomasterfrom
copilot/add-missing-dns-zone-commands

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Implements four missing OpenSRS DNS zone commands and exposes the existing DeleteDnsZoneRequest through DomainClient.

Changes

New Commands

  • ForceDnsNameservers - Forces domain to use OpenSRS DNS nameservers
  • GetDnsZone - Retrieves DNS records for a domain
  • SetDnsZone - Updates DNS zone records
  • ResetDnsZone - Resets DNS zone to template values

Each includes:

  • Request/Result class pair with XML serialization/parsing
  • Async method in DomainClient
  • Unit test coverage

Additional

  • Exposed DeleteDnsZoneAsync in DomainClient (request class existed but was not callable)

Usage

var client = new OpenSRSClient(httpClient, options);

// Get current DNS zone
var getResult = await client.GetDnsZoneAsync(new GetDnsZoneRequest { Domain = "example.com" });

// Update DNS records
var setResult = await client.SetDnsZoneAsync(new SetDnsZoneRequest 
{ 
    Domain = "example.com",
    Records = new DnsRecordSet { /* ... */ }
});

// Force to OpenSRS nameservers
await client.ForceDnsNameserversAsync(new ForceDnsNameserversRequest { Domain = "example.com" });

All implementations follow existing patterns: XPath-based XML parsing, ResponseDetails error handling, and null-safe element access.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Missing DNS Zone commands</issue_title>
<issue_description>We need to implement the following actions with appropriate Request and Result models:

https://domains.opensrs.guide/docs/force_dns_nameservers

https://domains.opensrs.guide/docs/get_dns_zone

https://domains.opensrs.guide/docs/set_dns_zone

https://domains.opensrs.guide/docs/set_dns_zone-

Then add methods to DomainClient to use them. Also add DeleteDnsZoneRequest to DomainClient</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: ahwm <20478373+ahwm@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing DNS Zone commands implementation Add missing DNS Zone commands Jan 27, 2026
Copilot AI requested a review from ahwm January 27, 2026 16:25
@ahwm ahwm marked this pull request as ready for review January 27, 2026 16:32
@ahwm ahwm merged commit 9892bd8 into master Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Missing DNS Zone commands

2 participants