windows server 2012

How to Install and Configure DNS Server on Windows Server 2016/2012 R2?


This article is a step by step tutorial on how to install and configure a DNS Server on Windows Server 2016 /2012 R2. Also we will show you how to create forward and reverse lookup zones. For a start, we’ll also take a look at what’s the DNS service and what it is used for.

DNS (Domain Name System) is a system that allows you to find the IP address of a host by a domain name and vice versa. DNS server—this network service provides and supports DNS operation. The DNS server may be responsible for the specific zone in which the corresponding computers are located. Since the DNS system is hierarchical system, the DNS server can redirect the request to the upstream server if it cannot determine the IP address of the host by the domain name.

Most often, the DNS server role is installed along with the installation of the Active Directory domain controller role. If you don’t need AD, you can install the DNS server role separately.

Important! Before install, make sure your DNS server has a static IP-address.

Now let’s begin.

The fastest way is to install the DNS server role in Windows Server 2016 using the following PowerShell command (run it with an administrator permissions):

Install-WindowsFeature DNS -IncludeManagementTools

You can also install the DNS server role from the Server Manager GUI. Open Server Manager and click on Add Roles and Features.

How to Install and Configure DNS Server on Windows Server

Select Role-based or feature-based installation option and click on Next.

Install and Configure DNS Server on Windows Server

Here you need to select desired server you’d like to install DNS Server (usually this is the current server).

Configure DNS Server on Windows Server

From Server Roles lists select DNS server and click on Next. Click Add Features on the popup window—in this case, the DNS management console and PowerShell DNS module will be installed automatically. If you want to manage this DNS server remotely, you can not install these tools.

DNS Server on Windows Server

Now you can see that item DNS is checked.

configuring DNS Server

No additional features required for this step, but we want to be sure that DNS Server Tools is already selected. To check this, click on Remote Server Administration > Role Administration Tools. Then click on Next.

configuring DNS Server guide

Here just click on Next.

configuring DNS Server tutorial

To confirm installation press Install.

configuring DNS Server on Windows Server machine

Installation process started, it may take few minutes.

DNS Server Installation is successfully completed, click on Close.

configuring DNS Server on Windows Server 2016 machine

So, the server role of the DNS server is installed. Now you can configure your DNS Server. To run DNS server management tools, click on Tools in the upper right corner of Server Manager and click on DNS in the drop-down list.

DNS on Windows Server machine

Select your server on the left side of DNS Manager window to open zone list.

Currently there are no zones configured on your DNS server. This server is called caching. Zones are parts of the namespace for which the server is responsible. Forward lookup zones are used to convert a name to an IP address. The reverse lookup zone, on the contrary, matches the IP address with the hostname. The presence of a reverse lookup zone on the DNS server is not necessary, but it is easy to configure and provides the full functionality of the DNS service.

Right-click on Forward Lookup Zones and click on New Zone from context menu to bring up the New Zone Wizard.

configuring DNS Server on Windows Server machine host

In this window click Next.

In this step you can select the type of DNS you want to use. The primary zone will be located on your server, the secondary zone will be located on another server. The secondary zone is used in large networks for load balancing. Choose Primary zone and click on Next to continue.

configuring DNS Server on Windows Server machine zone

Enter any name for new zone file and click on Next button.

installing DNS Server on Windows Server machine

Specify the name of the zone file.

installing DNS Server on Windows Server 2016

Dynamic updates allow DNS clients register their resource records in DNS database automatically, but if the network is small we can make updates of DNS database manually. It is recommended to allow dynamic updates, but only if DNS will be used exclusively on your local network. Otherwise, this item may entail security risks, as the “New Zone Wizard” will warn you about.

installing DNS

On the next window just click on Finish.

That’s all, forward zone created. Setting the zone is done by adding DNS records to the zone. There are several types of DNS records. Consider the main types of DNS records:

  • A-record (AAAA-record)—matches the hostname and IP address;
  • CNAME-record—used to forward to another name;
  • MX—mail entry, points to mail servers;
  • NS—points to DNS server.

If earlier you have chosen Do not to allow dynamic updates, you should add records to zone manually. To do this right click on zone name and click on New Host (A or AAAA).

installing DNS Server on Windows

Here enter name and IP-address of your DNS Server in appropriate fields and then click Add Host.

A message appears stating that the node has been created.

The host record was successfully created.

You can also create an A record using PowerShell:

Add-DnsServerResourceRecordA -Name 'client1' -ZoneName 'test.contoso.com’ -IPv4Address 192.168.0.100

As you can see on the right side of the DNS Manager window, the new host is now created. You can create records for client computers in exactly the same way.

Now you should add Reverse Lookup Zone. To do this right click on Reverse Lookup Zone and click on New Zone from the action menu to bring up the New Zone Wizard.

Next steps will be the same as for Forward Lookup Zone, click Next.

Choose Primary zone and click on Next to continue.

Here you need to select the type of IP-address, check on IPv4 and click on Next to continue.

In Network ID field enter the first three octets of your DNS Server IP-address.

Just click on Next.

DNS Server dynamic updates

Check Do not allow dynamic updates and press Next.

installing DNS Server on Windows Server machine dynamic updates

Click on Finish button and your DNS server is now configured and ready for use.

As you can see on the right side of DNS Manager window, Reverse Lookup Zone is now created.

DNS manager

In order to obtain domain name or IP address mapping using the command nslookup:

Nslookup client1.test.contoso.com

Tip. Don’t forget to check which DNS server is specified in the settings of the network interface (it should be, respectively, the IP address of the current server).

In order for a DNS server to resolve addresses in other zones, you need to configure DNS Forwarders. To do this, in the DNS Manager console, open the properties of your server.

installing DNS Server on Windows Server computer

Go to the Forwarders tab, click the Edit button and add the address of the external DNS server to which you want to forward requests (for example, 8.8.8.8).

installing DNS

You can also configure DNS Forwarders using the command:

Add-DnsServerForwarder -IPAddress 8.8.8.8 –PassThru

You may also like:

How to Truncate SQL Transaction Logs Transaction logs in SQL Server 2012 tend to grow over time, which can sometimes fill all your available disk space. To avoid this, SQL Server has Trun...
How to Setup FTP Server in Windows 10? FTP (File Transfer Protocol) is a popular Internet data transfer protocol. You can use FTP to transfer files between a remote server and a local PC. F...
Config Remote Desktop Easy Print on Server 2012 R2 TS Easy Print technology was first introduced in Windows Server 2008 as an alternative to the use of traditional printing subsystem on Remote Desktop ...
Renaming a Computer with SQL Server Instance After SQL Server installation internal SQL Server is based on the host computer name. However, when you are changing the host name, old SQL server nam...
Fixing DNS Server Not Responding Error on Windows ... Let's discuss a quite frequent problem, when user could not access Internet on the Windows computer. The problem is related to the inaccessible DNS se...

Add Your Comment