DNS is an addressing system that allows you to find a computer on the network by calling its friendly name rather than the IP address and vice versa. DNS role can deployed along with the Active directory role or it can be deployed separately.
This tutorial is on how to install and configure a DNS Server on a Windows Server using PowerShell.
Prerequisites for a DNS
- A fresh installation of Windows OS – Server 2019. 2016.
- Configure the system with Static IP.
- PowerShell DNS module
Install DNS role
DNS server role in Windows Server can be installed using the following PowerShell command
Install-WindowsFeature DNS -IncludeManagementTools
There are several types of DNS records.
- A-Record – set to match the hostname and IP address
- CNAME – record used to forward to another name
- MX – mail server such as exchange
- NS – Name server
Adding Address and PTR Records
A and PTR record can be added using PowerShell:
Add-DnsServerResourceRecordA -Name "sfo01-m01-esx07" -ZoneName "ash.local" -IPv4Address "172.16.11.107" -TimeToLive 01:00:00 -CreatePtr -PassThru
Display Address and PTR Records
Get-DnsServerResourceRecord -ZoneName ash.local -RRType A | Where-Object Hostname -like "esx"
Remove Address and PTR Records
Remove-DnsServerResourceRecord -ZoneName "ash.local" -RRType "A" -Name "sfo01-m01-esx07" -RecordData "172.16.11.107" -PassThru
(Visited 172 times, 1 visits today)