2016-02-03 01:48:09 +01:00
---
layout: "azurerm"
page_title: "Azure Resource Manager: azurerm_dns_zone"
sidebar_current: "docs-azurerm-resource-dns-zone"
description: |-
Create a DNS Zone.
---
# azurerm\_dns\_zone
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
2017-04-17 12:17:54 +02:00
```hcl
2016-02-03 01:48:09 +01:00
resource "azurerm_resource_group" "test" {
2017-02-18 23:48:50 +01:00
name = "acceptanceTestResourceGroup1"
location = "West US"
2016-02-03 01:48:09 +01:00
}
2017-02-18 23:48:50 +01:00
2016-02-03 01:48:09 +01:00
resource "azurerm_dns_zone" "test" {
2017-02-18 23:48:50 +01:00
name = "mydomain.com"
resource_group_name = "${azurerm_resource_group.test.name}"
2016-02-03 01:48:09 +01:00
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Required) The name of the DNS Zone. Must be a valid domain name.
2016-02-05 12:28:48 +01:00
* `resource_group_name` - (Required) Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
2016-02-03 01:48:09 +01:00
2017-02-18 23:48:50 +01:00
* `tags` - (Optional) A mapping of tags to assign to the resource.
2016-02-03 01:48:09 +01:00
## Attributes Reference
The following attributes are exported:
* `id` - The DNS Zone ID.
* `max_number_of_record_sets` - (Optional) Maximum number of Records in the zone. Defaults to `1000` .
* `number_of_record_sets` - (Optional) The number of records already in the zone.
2016-08-17 23:46:18 +02:00
* `name_servers` - (Optional) A list of values that make up the NS record for the zone.
2016-07-19 18:22:30 +02:00
## Import
2017-02-18 23:48:50 +01:00
DNS Zones can be imported using the `resource id` , e.g.
2016-07-19 18:22:30 +02:00
```
terraform import azurerm_dns_zone.zone1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/dnsZones/zone1
2016-08-17 23:46:18 +02:00
```