Configure Root Hints with PowerShell – Windows Server Core 2016

This guide shows you how to add and remove DNS root hints using PowerShell. To do this using DNS Manager, please see Configure Root Hints – 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

 

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 Root Hint
1) Check the current root hints

Type Get-DnsServerRootHint and hit Enter 

This will display any root hints that have already been added

2) Add a root hint

Type Add-DnsServerRootHint -NameServer “FQDN_Here” -IPAddress “IpAddressHere” and hit Enter

3) Confirm the root hint was added

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

To confirm, type Get-DnsServerRootHint and hit Enter 

This will should display the root hints again, with your new root hint included

Remove a Root Hint
1) Check the current root hints

Type Get-DnsServerRootHint to see the current root hints (see above)

2) Remove a root hint

Type Remove-DnsServerRootHint -NameServer “FQDN_Here” and hit Enter

Type Y and hit Enter to confirm

3) Confirm the root hint was removed

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

To confirm, type Get-DnsServerRootHint and hit Enter 

This will should display the root hint again, with your the root hint removed