Manage DNS zones using DNS server in Windows Server

Create primary, secondary, stub, and reverse DNS zones using the DNS server role in Windows Server. This article also shows you how to configure zone transfer settings and perform zone delegation.

Prerequisites

Before you can manage DNS zone in Windows Server, you need to complete the following prerequisites:

  • A Windows Server with the DNS Server role installed and configured. See Quickstart: Installing and configure DNS Server to found out how to get stared.
  • Determine the type of zone you want to create, see DNS zones to learn more.
  • An account that is a member of the Administrators group, or equivalent.
  • You need the fully qualified domain name (FQDN) of the zone you want to create.
  • If you want to create a secondary or stub zone, you need the IP address of the DNS server(s) hosting the primary zone.

You can remotely manage a Windows Server DNS server using all of the methods outlined in this article.

Create a primary zone

Create an Active Directory integrated primary zone

To create an Active Directory integrated primary zone, select the relevant method and follow the steps.

Here's how to create an Active Directory Integrated DNS zone using the Add-DnsServerPrimaryZone PowerShell command.

Create a new primary zone for north.contoso.com and set the replication scope, run the following command:

Add-DnsServerPrimaryZone -Name "north.contoso.com" -ReplicationScope "Forest" -PassThru

Create a file based primary zone

To create a file based primary zone, select the relevant method and follow the steps.

Here's how to create a file based DNS zone using the Add-DnsServerPrimaryZone PowerShell command.

To add the file based DNS zone east.contoso.com using the file east.contoso.com.dns, run the following command on a computer with the DNS server role installed:

Add-DnsServerPrimaryZone -Name "east.contoso.com" -ZoneFile "east.contoso.com.dns"

Create a secondary zone

To create a secondary zone, select the relevant method and follow the steps.

Here's how to create a secondary DNS zone using the Add-DnsServerSecondaryZone PowerShell command.

Add the secondary zone western.contoso.com using the zone file name south.contoso.dns and using the primary zone server at IP address 172.23.90.124 use the following command:

Add-DnsServerSecondaryZone -Name "south.contoso.com" -ZoneFile "south.contoso.com.dns" -MasterServers 172.23.90.124

Create a stub zone

To create a stub zone, select the relevant method and follow the steps.

Here's how to create a secondary DNS zone using the Add-DnsServerStubZone PowerShell command.

To add a stub zone for the west.contoso.com zone using the authoritative DNS server 172.23.90.124, run the following command:

Add-DnsServerStubZone -Name "west.contoso.com" -MasterServers "172.23.90.124" -PassThru -ZoneFile "west.contoso.com.dns"

Create a reverse lookup zone

To create a reverse lookup zone, select the relevant method and follow the steps.

Here's how to create an Active Directory Integrated reverse DNS zone using the Add-DnsServerPrimaryZone PowerShell command.

To add the reverse lookup zone for the 10.1.0.0/24 IPv4 address range and set the replication scope, run the following command.

Add-DnsServerPrimaryZone -NetworkID "10.1.0.0/24" -ReplicationScope "Forest"

Configure zone transfer settings

To configure the zone transfer settings for a primary DNS zone, select the relevant method and follow the steps.

Here's how to set the zone transfer settings for an existing DNS zone using the Set-DnsServerPrimaryZone PowerShell command.

To configure zone transfers to only be allowed to servers in the name servers (NS) records for west.contoso.com DNS zone, run the following command.

Set-DnsServerPrimaryZone -name "west.contoso.com" -SecureSecondaries "TransferToZoneNameServer" -PassThru

Perform zone delegation

To perform zone delegation for a subdomain, select the relevant method and follow the steps.

Here's how to delegate the south.west.contoso.com subdomain using the Add-DnsServerZoneDelegation PowerShell command.

To delegate the south subdomain to the name server west-ns01.contoso.com using an IP address of 172.23.90.136, run the following command.

Add-DnsServerZoneDelegation -Name "west.contoso.com" -ChildZoneName "south" -NameServer "west-ns01.contoso.com" -IPAddress 172.23.90.136 -PassThru -Verbose

Next steps

Now that you've created a DNS zone, configured zone transfer settings and performed zone delegation, here's other articles to consider.