How to add DNS services to Windows Server 2016

I get it.  DNS can be confusing.  It’s so simple right? Just turn an hostname like www.asdf[.]com into an IP address.

Ah yes the but the complexity is in the details right!

So in this little tutorial series I’m going to show you how to configure a Windows 2016 Server with DNS services.  We’re going to pull this off using both the Server Manager and PowerShell and it’s gonna be awesome.

First I’m going to show you how to add the DNS server role to the server and then how to test it to make sure it’s working. You ready for this!?

So in this quick tutorial I’m going to show you how to tell the Windows Server 2016 to use itself as the DNS server, so when the server needs to make a DNS request it’ll use itself for the DNS request rather than an external source such as 8.8.8.8 (which is Google’s public DNS server)

Now you might be thinking how is this going to work?  I mean, if we configure the server to use itself to resolve domain names how is it going to do that?

The server is going to be like:

Uh, Vonnie… I feel really stupid right now because I’ve got this hostname, youtube.com and I have absolutely no idea how to resolve that thing into an IP address…

So to get around this, to make our Windows 2016 Server happy , we’ll configure it as a DNS Forwarder.

Why are we doing this?

Because when the server tries to resolve a name it doesn’t know, it can forward that request to another DNS server, such as 8.8.8.8, which might have the answer.  Then the 8.8.8.8 server would fetch the request, return it to our local DNS server and then this DNS server would cache the response before sending it back to the client.

How to configure DNS on Windows Server 2016

In Server Manager, we can go to “Add Roles and Features”

Windows Server 2016 Server Manager

We can leave “Role-based or feature based installation” enabled.

Role Based Installation

Then we’ll leave the default server selected.  It’s just asking us which server we want to install the software on.  We only have one Windows 2016 Server here so I’ll just click Next.

Which server do you want to install it on?

And then I’ll select “DNS Server” and include management tools so we can add the DNS Server role to the server (and manage it! lolol)

Add the DNS server role to Windows Server 2016

I’ll click next again because I don’t need to add any additional features here…

Install additional features

Click “Add Features” to get this thing going…

Confirm the DNS server roleThen give the DNS overview a quick read (you should at least read it once) and click next to install it.

Adding the DNS Server Role using PowerShell

We could also have used PowerShell to do this- which honestly is the best way to pull this trick off.

You would type:

Add-WindowsFeature -Name DNS -IncludeManagementTools

Adding the DNS Server role using PowerShell

And that’s it. As you can see I’m PowerShell biased.

It’s friggin awesome.

In the next post I’ll show you how to configure DNS and actually setup the DNS forwarder.

The Bottom Line

To add the DNS server role to a Windows 2016 server just use PowerShell:

Add-WindowsFeature -Name DNS -IncludeManagementTools

You’ll be done in no time and it’s super easy to remember.

 

About

Connect with Vonnie on Twitter

Posted in Windows Server