1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. dns
  6. Zone

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Enables you to manage DNS zones within Azure DNS. These zones are hosted on Azure’s name servers to which you can delegate the zone from the parent domain.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var example = new Azure.Core.ResourceGroup("example", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var example_public = new Azure.Dns.Zone("example-public", new Azure.Dns.ZoneArgs
            {
                ResourceGroupName = example.Name,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/dns"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = dns.NewZone(ctx, "example-public", &dns.ZoneArgs{
    			ResourceGroupName: example.Name,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {location: "West Europe"});
    const example_public = new azure.dns.Zone("example-public", {resourceGroupName: example.name});
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example", location="West Europe")
    example_public = azure.dns.Zone("example-public", resource_group_name=example.name)
    

    Example coming soon!

    Create Zone Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Zone(name: string, args: ZoneArgs, opts?: CustomResourceOptions);
    @overload
    def Zone(resource_name: str,
             args: ZoneArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Zone(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             resource_group_name: Optional[str] = None,
             name: Optional[str] = None,
             soa_record: Optional[ZoneSoaRecordArgs] = None,
             tags: Optional[Mapping[str, str]] = None)
    func NewZone(ctx *Context, name string, args ZoneArgs, opts ...ResourceOption) (*Zone, error)
    public Zone(string name, ZoneArgs args, CustomResourceOptions? opts = null)
    public Zone(String name, ZoneArgs args)
    public Zone(String name, ZoneArgs args, CustomResourceOptions options)
    
    type: azure:dns:Zone
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ZoneArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ZoneArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ZoneArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ZoneArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ZoneArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var zoneResource = new Azure.Dns.Zone("zoneResource", new()
    {
        ResourceGroupName = "string",
        Name = "string",
        SoaRecord = new Azure.Dns.Inputs.ZoneSoaRecordArgs
        {
            Email = "string",
            HostName = "string",
            ExpireTime = 0,
            Fqdn = "string",
            MinimumTtl = 0,
            RefreshTime = 0,
            RetryTime = 0,
            SerialNumber = 0,
            Tags = 
            {
                { "string", "string" },
            },
            Ttl = 0,
        },
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := dns.NewZone(ctx, "zoneResource", &dns.ZoneArgs{
    	ResourceGroupName: pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	SoaRecord: &dns.ZoneSoaRecordArgs{
    		Email:        pulumi.String("string"),
    		HostName:     pulumi.String("string"),
    		ExpireTime:   pulumi.Int(0),
    		Fqdn:         pulumi.String("string"),
    		MinimumTtl:   pulumi.Int(0),
    		RefreshTime:  pulumi.Int(0),
    		RetryTime:    pulumi.Int(0),
    		SerialNumber: pulumi.Int(0),
    		Tags: pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    		Ttl: pulumi.Int(0),
    	},
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var zoneResource = new com.pulumi.azure.dns.Zone("zoneResource", com.pulumi.azure.dns.ZoneArgs.builder()
        .resourceGroupName("string")
        .name("string")
        .soaRecord(ZoneSoaRecordArgs.builder()
            .email("string")
            .hostName("string")
            .expireTime(0)
            .fqdn("string")
            .minimumTtl(0)
            .refreshTime(0)
            .retryTime(0)
            .serialNumber(0)
            .tags(Map.of("string", "string"))
            .ttl(0)
            .build())
        .tags(Map.of("string", "string"))
        .build());
    
    zone_resource = azure.dns.Zone("zoneResource",
        resource_group_name="string",
        name="string",
        soa_record={
            "email": "string",
            "host_name": "string",
            "expire_time": 0,
            "fqdn": "string",
            "minimum_ttl": 0,
            "refresh_time": 0,
            "retry_time": 0,
            "serial_number": 0,
            "tags": {
                "string": "string",
            },
            "ttl": 0,
        },
        tags={
            "string": "string",
        })
    
    const zoneResource = new azure.dns.Zone("zoneResource", {
        resourceGroupName: "string",
        name: "string",
        soaRecord: {
            email: "string",
            hostName: "string",
            expireTime: 0,
            fqdn: "string",
            minimumTtl: 0,
            refreshTime: 0,
            retryTime: 0,
            serialNumber: 0,
            tags: {
                string: "string",
            },
            ttl: 0,
        },
        tags: {
            string: "string",
        },
    });
    
    type: azure:dns:Zone
    properties:
        name: string
        resourceGroupName: string
        soaRecord:
            email: string
            expireTime: 0
            fqdn: string
            hostName: string
            minimumTtl: 0
            refreshTime: 0
            retryTime: 0
            serialNumber: 0
            tags:
                string: string
            ttl: 0
        tags:
            string: string
    

    Zone Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Zone resource accepts the following input properties:

    ResourceGroupName string
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    Name string
    The name of the DNS Zone. Must be a valid domain name.
    SoaRecord ZoneSoaRecord
    An soa_record block as defined below. Changing this forces a new resource to be created.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the Record Set.
    ResourceGroupName string
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    Name string
    The name of the DNS Zone. Must be a valid domain name.
    SoaRecord ZoneSoaRecordArgs
    An soa_record block as defined below. Changing this forces a new resource to be created.
    Tags map[string]string
    A mapping of tags to assign to the Record Set.
    resourceGroupName String
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    name String
    The name of the DNS Zone. Must be a valid domain name.
    soaRecord ZoneSoaRecord
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags Map<String,String>
    A mapping of tags to assign to the Record Set.
    resourceGroupName string
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    name string
    The name of the DNS Zone. Must be a valid domain name.
    soaRecord ZoneSoaRecord
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags {[key: string]: string}
    A mapping of tags to assign to the Record Set.
    resource_group_name str
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    name str
    The name of the DNS Zone. Must be a valid domain name.
    soa_record ZoneSoaRecordArgs
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags Mapping[str, str]
    A mapping of tags to assign to the Record Set.
    resourceGroupName String
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    name String
    The name of the DNS Zone. Must be a valid domain name.
    soaRecord Property Map
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags Map<String>
    A mapping of tags to assign to the Record Set.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Zone resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    MaxNumberOfRecordSets int
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    NameServers List<string>
    (Optional) A list of values that make up the NS record for the zone.
    NumberOfRecordSets int
    (Optional) The number of records already in the zone.
    Id string
    The provider-assigned unique ID for this managed resource.
    MaxNumberOfRecordSets int
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    NameServers []string
    (Optional) A list of values that make up the NS record for the zone.
    NumberOfRecordSets int
    (Optional) The number of records already in the zone.
    id String
    The provider-assigned unique ID for this managed resource.
    maxNumberOfRecordSets Integer
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    nameServers List<String>
    (Optional) A list of values that make up the NS record for the zone.
    numberOfRecordSets Integer
    (Optional) The number of records already in the zone.
    id string
    The provider-assigned unique ID for this managed resource.
    maxNumberOfRecordSets number
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    nameServers string[]
    (Optional) A list of values that make up the NS record for the zone.
    numberOfRecordSets number
    (Optional) The number of records already in the zone.
    id str
    The provider-assigned unique ID for this managed resource.
    max_number_of_record_sets int
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    name_servers Sequence[str]
    (Optional) A list of values that make up the NS record for the zone.
    number_of_record_sets int
    (Optional) The number of records already in the zone.
    id String
    The provider-assigned unique ID for this managed resource.
    maxNumberOfRecordSets Number
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    nameServers List<String>
    (Optional) A list of values that make up the NS record for the zone.
    numberOfRecordSets Number
    (Optional) The number of records already in the zone.

    Look up Existing Zone Resource

    Get an existing Zone resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ZoneState, opts?: CustomResourceOptions): Zone
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            max_number_of_record_sets: Optional[int] = None,
            name: Optional[str] = None,
            name_servers: Optional[Sequence[str]] = None,
            number_of_record_sets: Optional[int] = None,
            resource_group_name: Optional[str] = None,
            soa_record: Optional[ZoneSoaRecordArgs] = None,
            tags: Optional[Mapping[str, str]] = None) -> Zone
    func GetZone(ctx *Context, name string, id IDInput, state *ZoneState, opts ...ResourceOption) (*Zone, error)
    public static Zone Get(string name, Input<string> id, ZoneState? state, CustomResourceOptions? opts = null)
    public static Zone get(String name, Output<String> id, ZoneState state, CustomResourceOptions options)
    resources:  _:    type: azure:dns:Zone    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    MaxNumberOfRecordSets int
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    Name string
    The name of the DNS Zone. Must be a valid domain name.
    NameServers List<string>
    (Optional) A list of values that make up the NS record for the zone.
    NumberOfRecordSets int
    (Optional) The number of records already in the zone.
    ResourceGroupName string
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    SoaRecord ZoneSoaRecord
    An soa_record block as defined below. Changing this forces a new resource to be created.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the Record Set.
    MaxNumberOfRecordSets int
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    Name string
    The name of the DNS Zone. Must be a valid domain name.
    NameServers []string
    (Optional) A list of values that make up the NS record for the zone.
    NumberOfRecordSets int
    (Optional) The number of records already in the zone.
    ResourceGroupName string
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    SoaRecord ZoneSoaRecordArgs
    An soa_record block as defined below. Changing this forces a new resource to be created.
    Tags map[string]string
    A mapping of tags to assign to the Record Set.
    maxNumberOfRecordSets Integer
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    name String
    The name of the DNS Zone. Must be a valid domain name.
    nameServers List<String>
    (Optional) A list of values that make up the NS record for the zone.
    numberOfRecordSets Integer
    (Optional) The number of records already in the zone.
    resourceGroupName String
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    soaRecord ZoneSoaRecord
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags Map<String,String>
    A mapping of tags to assign to the Record Set.
    maxNumberOfRecordSets number
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    name string
    The name of the DNS Zone. Must be a valid domain name.
    nameServers string[]
    (Optional) A list of values that make up the NS record for the zone.
    numberOfRecordSets number
    (Optional) The number of records already in the zone.
    resourceGroupName string
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    soaRecord ZoneSoaRecord
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags {[key: string]: string}
    A mapping of tags to assign to the Record Set.
    max_number_of_record_sets int
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    name str
    The name of the DNS Zone. Must be a valid domain name.
    name_servers Sequence[str]
    (Optional) A list of values that make up the NS record for the zone.
    number_of_record_sets int
    (Optional) The number of records already in the zone.
    resource_group_name str
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    soa_record ZoneSoaRecordArgs
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags Mapping[str, str]
    A mapping of tags to assign to the Record Set.
    maxNumberOfRecordSets Number
    (Optional) Maximum number of Records in the zone. Defaults to 1000.
    name String
    The name of the DNS Zone. Must be a valid domain name.
    nameServers List<String>
    (Optional) A list of values that make up the NS record for the zone.
    numberOfRecordSets Number
    (Optional) The number of records already in the zone.
    resourceGroupName String
    Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
    soaRecord Property Map
    An soa_record block as defined below. Changing this forces a new resource to be created.
    tags Map<String>
    A mapping of tags to assign to the Record Set.

    Supporting Types

    ZoneSoaRecord, ZoneSoaRecordArgs

    Email string
    The email contact for the SOA record.
    HostName string
    The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com..
    ExpireTime int
    The expire time for the SOA record. Defaults to 2419200.
    Fqdn string
    MinimumTtl int
    The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300.
    RefreshTime int
    The refresh time for the SOA record. Defaults to 3600.
    RetryTime int
    The retry time for the SOA record. Defaults to 300.
    SerialNumber int
    The serial number for the SOA record. Defaults to 1.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the Record Set.
    Ttl int
    The Time To Live of the SOA Record in seconds. Defaults to 3600.
    Email string
    The email contact for the SOA record.
    HostName string
    The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com..
    ExpireTime int
    The expire time for the SOA record. Defaults to 2419200.
    Fqdn string
    MinimumTtl int
    The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300.
    RefreshTime int
    The refresh time for the SOA record. Defaults to 3600.
    RetryTime int
    The retry time for the SOA record. Defaults to 300.
    SerialNumber int
    The serial number for the SOA record. Defaults to 1.
    Tags map[string]string
    A mapping of tags to assign to the Record Set.
    Ttl int
    The Time To Live of the SOA Record in seconds. Defaults to 3600.
    email String
    The email contact for the SOA record.
    hostName String
    The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com..
    expireTime Integer
    The expire time for the SOA record. Defaults to 2419200.
    fqdn String
    minimumTtl Integer
    The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300.
    refreshTime Integer
    The refresh time for the SOA record. Defaults to 3600.
    retryTime Integer
    The retry time for the SOA record. Defaults to 300.
    serialNumber Integer
    The serial number for the SOA record. Defaults to 1.
    tags Map<String,String>
    A mapping of tags to assign to the Record Set.
    ttl Integer
    The Time To Live of the SOA Record in seconds. Defaults to 3600.
    email string
    The email contact for the SOA record.
    hostName string
    The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com..
    expireTime number
    The expire time for the SOA record. Defaults to 2419200.
    fqdn string
    minimumTtl number
    The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300.
    refreshTime number
    The refresh time for the SOA record. Defaults to 3600.
    retryTime number
    The retry time for the SOA record. Defaults to 300.
    serialNumber number
    The serial number for the SOA record. Defaults to 1.
    tags {[key: string]: string}
    A mapping of tags to assign to the Record Set.
    ttl number
    The Time To Live of the SOA Record in seconds. Defaults to 3600.
    email str
    The email contact for the SOA record.
    host_name str
    The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com..
    expire_time int
    The expire time for the SOA record. Defaults to 2419200.
    fqdn str
    minimum_ttl int
    The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300.
    refresh_time int
    The refresh time for the SOA record. Defaults to 3600.
    retry_time int
    The retry time for the SOA record. Defaults to 300.
    serial_number int
    The serial number for the SOA record. Defaults to 1.
    tags Mapping[str, str]
    A mapping of tags to assign to the Record Set.
    ttl int
    The Time To Live of the SOA Record in seconds. Defaults to 3600.
    email String
    The email contact for the SOA record.
    hostName String
    The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com..
    expireTime Number
    The expire time for the SOA record. Defaults to 2419200.
    fqdn String
    minimumTtl Number
    The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300.
    refreshTime Number
    The refresh time for the SOA record. Defaults to 3600.
    retryTime Number
    The retry time for the SOA record. Defaults to 300.
    serialNumber Number
    The serial number for the SOA record. Defaults to 1.
    tags Map<String>
    A mapping of tags to assign to the Record Set.
    ttl Number
    The Time To Live of the SOA Record in seconds. Defaults to 3600.

    Import

    DNS Zones can be imported using the resource id, e.g.

     $ pulumi import azure:dns/zone:Zone zone1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/dnszones/zone1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.