Setting Up the DNS Server Role on Windows Server

The DNS Server role on Windows Server is almost always deployed alongside Active Directory, since AD relies fundamentally on DNS for locating domain controllers and services.

Install-WindowsFeature DNS -IncludeManagementTools

# Create a primary forward lookup zone
Add-DnsServerPrimaryZone -Name "corp.local" -ZoneFile "corp.local.dns"

# Add an A record
Add-DnsServerResourceRecordA -ZoneName "corp.local" -Name "fileserver" -IPv4Address "192.168.1.20"

# Create a reverse lookup zone (IP-to-name resolution)
Add-DnsServerPrimaryZone -NetworkID "192.168.1.0/24" -ZoneFile "1.168.192.in-addr.arpa.dns"

# Configure forwarders for external domain resolution
Set-DnsServerForwarder -IPAddress 1.1.1.1, 1.0.0.1

Active Directory-Integrated Zones

Rather than storing zone data in a plain file, AD-integrated zones store DNS records directly in Active Directory itself, replicating automatically to every domain controller — the standard, recommended configuration for a domain’s internal DNS, since it inherits AD’s own multi-master replication and fault tolerance for free.