DNS is one of the most important services to keep local to your users. A remote DNS means that every name resolution request experiences latency, and that means every connection to every service will be slower than it needs to be…even to local file and print resources. Many offices are considered too small, too remote, or too insecure to deploy more than the bare minimum number of servers to, which is a scenario that Windows Server 2016 Nano edition and Windows Hyper-V Server 2016 can solve. Configure a single, smaller, piece of hardware running Hyper-V Server 2016 as a minimal host, and deploy VMs on it to provide local resources like DNS, F&P, and perhaps IIS for some local apps. We’re going to look at the DNS aspect in this post.
We’re assuming in this post that you have a Hyper-V host in place which has the resources to host a Nano VM. Sure, if you had the Hyper-V host already in place, you could deploy DNS on to it, but in the interest of keeping this remote office as low maintenance as possible, running things as thinly as you can, and minimizing both patching and reboot down times, keeping the server headless, and being able to administer things remotely through tools or even a console emulator, Nano is the way to go. Once your Nano server is deployed, here’s how to get DNS going.
Connecting to the Nano server
As long as you know either the ip.addr or the FQDN of the Nano server, you can connect to it for remote management. We’ll start by using remote PowerShell.
- Open an administrative PS session on your local machine.
- Run this command so that the server will be added to the list of trusted hosts:
Set-Item WSMan:\localhost\Client\TrustedHosts “<IP address of Nano Server>”
- Run these commands in the same administrative PS session: $ip = “<IP address of Nano Server>” $user = “$ip\Administrator” Enter-PSSession -ComputerName $ip -Credential $user
You are now running PS commands on the Nano server in an administrative context!
Deploying the DNS service onto the Nano server
First, you need to enable the service. You need to unpack the service, import it, and the management cmdlets. In the same PS session, which is now remote on the Nano server, run the following three commands.
- Enable-WindowsOptionalFeature -Online -FeatureName DNS-Server-Full-Role
- import-module DNSServer
- get-command -Module DNSServer
Now you are ready to get DNS set up the way you need it.
Setting up the DNS service
You can set up the DNS service on your Nano to be a caching-only server, which will minimize memory and effort, while still providing local name resolution for your users, except of course for the first one to need to resolve a query! You can also set up the Nano DNS as the secondary to other servers, or as authoritative for a domain. Just remember that since this is Nano, it’s not going to be able to read from or store zones in Active Directory, so you will be dealing with a file-based DNS. That doesn’t mean you cannot host the entire AD zone as a secondary zone on the server, just that you will have to set it up and point it to a domain controller as it’s primary. Here are some example commands to get you started.
Add a primary zone to your DNS server
Add-DnsServerPrimaryZone -ZoneName example.com -ZoneFile example.com.dns
Add an A record to that zone
Add-DnsServerResourceRecordA -Name webserver1 -ZoneName example.com -IPv4Address 10.1.2.3
Add a CNAME record to that zone
Add-DnsServerResourceRecordCName -Name www -ZoneName example.com -HostNameAlias webserver1
Add a Secondary zone to the server
Add-DnsServerSecondaryZone -Name “example.com” -ZoneFile “example.com.dns” -MasterServers 10.9.8.7
You can find more examples of the DNS commands and options using PS help, or at this TechNet article.
So what do you think? Is Nano server appealing to you? Would running DNS on it in your remote office (or Azure or AWS) be something you will do? Leave a comment below and let us know what you think and what you’re planning!
Image Source: Shutterstock