public sealed class WindowsDnsClient Windows DNS server administration through its MicrosoftDNS provider.
Remarks
The server must have the DNS role/provider installed. Uses the caller's identity unless credentials are supplied.
Constructors
WindowsDnsClient
public WindowsDnsClient(string server, NetworkCredential? credential = null, TimeSpan? queryTimeout = null) Creates an explicit server client. Timeout bounds WMI query waits; it is not a hard cancellation deadline for server mutations.
Methods
CreateAsync
public Task CreateAsync(DnsRecordSpecification specification, CancellationToken cancellationToken = default) Creates one record. Existing identical data is a conflict; other records in the set are preserved.
DeleteAsync
public Task<bool> DeleteAsync(DnsRecordKey key, CancellationToken cancellationToken = default) Deletes exactly one matching record. Returns false when absent; never removes a complete record set implicitly.
EnumerateRecordsAsync
public Task<ImmutableArray<DnsRecordSnapshot>> EnumerateRecordsAsync(string zone, string? ownerName = null, CancellationToken cancellationToken = default) Enumerates records, including unsupported native types as preserved textual records.
EnumerateZonesAsync
public Task<ImmutableArray<DnsZoneSnapshot>> EnumerateZonesAsync(CancellationToken cancellationToken = default) Enumerates zones and their AD integration status.
FindAsync
public Task<DnsRecordSnapshot?> FindAsync(DnsRecordKey key, CancellationToken cancellationToken = default) Finds a unique record by full record data, without assuming an owner name identifies a whole record set.
FindZoneAsync
public Task<DnsZoneSnapshot?> FindZoneAsync(string name, CancellationToken cancellationToken = default) Finds a zone; null means the named zone is absent on this server.
UpdateAsync
public Task UpdateAsync(DnsRecordKey key, DnsRecordUpdate update, CancellationToken cancellationToken = default) Modifies a single record in place. Record type and owner remain unchanged.