Azure DNS libraries for .NET

Use the Microsoft Azure DNS libraries for .NET to create and modify DNS zones and records hosted within Azure. Zones and records are managed as Azure Resources. Learn more by reading the Azure DNS overview.

Management library

Use the management library to create and modify DNS zones and records that are hosted in Azure.

Install the NuGet package directly from the Visual Studio Package Manager console or with the .NET Core CLI.

Visual Studio Package Manager

Install-Package Microsoft.Azure.Management.Dns
dotnet add package Microsoft.Azure.Management.Dns


The following example creates a new DNS zone.

using Microsoft.Rest.Azure.Authentication;
using Microsoft.Azure.Management.Dns;
using Microsoft.Azure.Management.Dns.Models;
Microsoft.Rest.ServiceClientCredentials serviceCreds = await ApplicationTokenProvider.LoginSilentAsync(tenantId, clientId, secret);
DnsManagementClient dnsClient = new DnsManagementClient(serviceCreds);            
Zone dnsZoneParams = new Zone("global");
dnsZoneParams.Tags = new Dictionary<string, string>();
dnsZoneParams.Tags.Add("dept", "finance");
Zone dnsZone =
    await dnsClient.Zones.CreateOrUpdateAsync(resourceGroupName, zoneName, dnsZoneParams, null, "*");


Explore more sample .NET code you can use in your apps.