Configure Reverse Lookup Zone with PowerShell – Windows Server Core 2016

This is a guide for adding and removing reverse lookup zones using PowerShell. To do this with Server Manager, please see Configure Reverse Lookup Zone – Windows Server 2016.

How-To

Prerequisites

Before starting, you will need the DNS role installed. If you have not done this, you can use one of the following articles:

For Server Core 2016 or Server 2016 with Desktop Experience

Installing the DNS Role with PowerShell -Windows Server Core 2016

For Server 2016 with Desktop Experience

Installing the DNS Role using Server Manager – Windows Server 2016

Assumptions

In this guide, I will be setting up a reverse lookup zone for an IPv4 primary zone. This primary zone is connected to Active Directory. However, this process can be easily adapted for other types of reverse lookup zones.

Open PowerShell
1a) Open Command Prompt (cmd) as an Administrator and start PowerShell

If you are on Server Core this is likely already open. If it is not, hold Ctrl+Alt+Del and select Task Manager. Then choose File -> Run new task, type cmd, select **Run with administrative privileges **and click OK or hit Enter.

Type the word PowerShell and hit Enter

1b) Open PowerShell as an Administrator

If using Server 2016 with the desktop experience, you can simply open PowerShell as an admin

Start typing PowerShell in the Start Menu and then right-click Windows PowerShell and select Run as administrator

Add a Reverse Lookup Zone
1) Check the current zones

Type Get-DnsServerZoneand hit Enter

This will display any DNS zones that have already been added

2) Add a reverse lookup zone

Type **Add-DnsServerPrimaryZone -NetworkID “NetworkIDHere” -ReplicationScope “ReplciationScopeHere” **and hit Enter

3) Confirm the zone was added

If there was no error message when running the command above, then the zone was added successfully

To confirm, type Get-DnsServerZone and hit Enter

This will should display the DNS zones again, with your new zone included

Remove a Reverse Lookup Zone
1) Check the current forwarders

Type Get-DnsServerZone to see the current forwarders (see above)

2) Remove a conditonal forwarder

Type **Remove-DnsServerZone -Name NameOfZoneHere **and hit Enter

Type Y and hit Enter to confirm

3) Confirm the conditional forwarder was removed

If there was no error message when running the command above, then the zone was removed successfully

To confirm, type Get-DnsServerZone and hit Enter

This will should display the DNS zones again, with the zone removed