Add DNS Entry To Nano Server 2016 DNS Server Using PowerShell

After creating a Primary DNS Zone on my Nano Server today I’ll show how I add A, CNAME, MX records to my DNS Server running on Nano Server 2016 using PowerShell.

If you haven’t setup your Nano Server use my article on how Install And Run Nano Server Technical Preview 5.

Once your Nano Server Is Configured Connect to It using PowerShell Direct, Connect To A Nano Server Using PowerShell Direct or using PowerShell Remoting How To Connect To A Windows Nano Server Using PowerShell.

To setup a DNS A Record I use the cmdlet below:

Add-dnsserverResourceRecordA -ipv4address 192.168.100.116 -Name TestSRV01 -ZoneName test.local -PassThru

To view all recoded and the new DNS entry I use the cmdlet:

Get-dnsserverResourceRecord -zone test.local

To add a CNAME record I type:

Add-dnsserverResourceRecordRecordCname -Name "NanoHost1" -HostNameAlias "host1.test.local" -zonename "test.local" -passThru

To add a DNS MX record I use the cmdlet below:

Add-DnsServerResourceRecordMX -Name Webmail -MailExchange 192.168.100.16 -preference 1 -zonename test.local -PassThru

Leave a Reply