Master the Domain Name System - the foundation of network communication
DNS (Domain Name System) translates human-readable names to IP addresses. It's a distributed, hierarchical database.
DNS uses a tree structure with the root at the top:
. (Root)
│
┌───────────┼───────────┐
│ │ │
com org local
│ │
google hexworth
│ │
www dc01
| Level | Example | Description |
|---|---|---|
| Root | . (dot) | Top of hierarchy, 13 root server clusters worldwide |
| TLD | .com, .org, .local | Top-Level Domain, managed by registries |
| Second-Level | hexworth.local | Your organization's domain |
| Subdomain | dc01.hexworth.local | Hosts and child domains |
When DNS is AD-integrated:
Name → IP Address
IP Address → Name
.in-addr.arpa suffix. For subnet 192.168.1.0/24, create zone 1.168.192.in-addr.arpa
| Type | Purpose | Example |
|---|---|---|
| A | Maps hostname to IPv4 address | dc01 → 192.168.1.10 |
| AAAA | Maps hostname to IPv6 address | dc01 → 2001:db8::1 |
| CNAME | Alias pointing to another name | mail → exchange01.hexworth.local |
| MX | Mail exchanger for domain | hexworth.local → mail.hexworth.local (priority 10) |
| Type | Purpose | Example |
|---|---|---|
| PTR | Reverse lookup (IP to name) | 10.1.168.192 → dc01.hexworth.local |
| SRV | Service location | _ldap._tcp → dc01.hexworth.local:389 |
| NS | Name server for zone | hexworth.local → dc01.hexworth.local |
| SOA | Start of Authority (zone info) | Serial, refresh, retry, expire, TTL |
Active Directory relies heavily on SRV records for service discovery:
_service._protocol.name TTL class SRV priority weight port target
nslookup -type=srv _ldap._tcp.dc._msdcs.hexworth.local
Forwarders send queries for external domains to another DNS server instead of using root hints.
Dynamic updates allow clients to automatically register their DNS records:
| Setting | Description | When to Use |
|---|---|---|
| None | No dynamic updates allowed | Static-only environments |
| Nonsecure and Secure | Any client can register | Non-AD environments only |
| Secure Only | Only authenticated clients | Recommended for AD |
Lock down the zone so only authenticated AD clients can register records.
Resolve a hostname to its IP address using the default DNS server.
Query a specific record type like MX to find the mail servers for a domain.
Use Resolve-DnsName for richer PowerShell output with object properties.
Flush the local DNS cache on a client machine when stale records cause problems.
On the DNS server itself, flush the server-side cache to force fresh lookups.
Inspect what records are currently cached on the local client.
nltest /dsregdnsScavenging automatically removes stale (old) DNS records that are no longer valid.
Turn on automatic scavenging at the server level with a 7-day interval.
Enable aging on the specific zone so stale records get timestamped.
Verify the current scavenging configuration on the server.
List every DNS zone hosted on the server to see what is configured.
Create a new A record to map a hostname to an IP address in a zone.
View all DNS records within a specific zone to audit its contents.
Use Resolve-DnsName to test name resolution from the client perspective.