“It’s always DNS” is a joke because it’s so often true. When a user says an app is down, the server is frequently fine – their computer just can’t find it. This guide gives you the basics of DNS and DHCP, and a routine to rule them in or out fast.
DNS in one minute
DNS turns names (app01.contoso.local) into IP addresses (10.0.0.25). When a computer looks up a name it:
- Checks its own cache (and the
hostsfile). - Asks its configured DNS server.
- That server answers from its zones, its cache, or by asking other servers (forwarders or root servers).
In an Active Directory network, domain controllers usually run DNS, and AD itself uses special DNS records to let computers find domain controllers. Broken DNS means broken logons.
Records you’ll use every week
| Record | Example | Purpose |
|---|---|---|
| A | app01 → 10.0.0.25 |
Name to IPv4 address |
| AAAA | app01 → fd00::25 |
Name to IPv6 address |
| CNAME | reports → app01 |
An alias pointing to another name |
| PTR | 10.0.0.25 → app01 |
Reverse lookup (IP to name) |
| SRV | _ldap._tcp.dc._msdcs.contoso.local |
Lets clients find services such as domain controllers |
| MX | mail server for a domain | Email delivery |
TTL (time to live) is how long others may cache an answer. Lower it a day before you change an important record, so the change spreads quickly.
Commands that answer most questions
# What does this computer think the name is?
Resolve-DnsName app01.contoso.local
# Ask a specific DNS server (bypasses this computer's cache)
Resolve-DnsName app01.contoso.local -Server 10.0.0.10
# Reverse lookup
Resolve-DnsName 10.0.0.25
# Can I find a domain controller?
Resolve-DnsName -Type SRV _ldap._tcp.dc._msdcs.contoso.local
# Which DNS servers does this computer use?
Get-DnsClientServerAddress -AddressFamily IPv4
# Clear this computer's DNS cache after a record change
Clear-DnsClientCache
nslookup still works, but Resolve-DnsName returns objects you can filter, and it uses the same resolver path as applications.
Managing records on a Windows DNS server
# Add an A record (and its PTR, if the reverse zone exists)
Add-DnsServerResourceRecordA -ZoneName contoso.local -Name app02 -IPv4Address 10.0.0.26 -CreatePtr
# Add an alias
Add-DnsServerResourceRecordCName -ZoneName contoso.local -Name reports -HostNameAlias app02.contoso.local
# Find records
Get-DnsServerResourceRecord -ZoneName contoso.local -Name app02
DHCP in one minute
DHCP hands out IP settings automatically. The client and server exchange four messages – Discover, Offer, Request, Acknowledge (DORA). The client gets an IP address, subnet mask, default gateway and DNS servers for a lease period.
Key ideas:
- Scope – the range of addresses for a subnet, e.g. 10.0.1.50–10.0.1.200
- Exclusions – addresses inside the range DHCP must not hand out
- Reservations – always give the same IP to a specific device (printers, appliances)
- Options – gateway (003), DNS servers (006), DNS domain name (015)
- Relay / IP helper – routers forward DHCP requests to a DHCP server in another subnet
Servers should normally have static IPs, not DHCP addresses.
Get-DhcpServerv4Scope
Get-DhcpServerv4Lease -ScopeId 10.0.1.0 | Select-Object IPAddress, HostName, AddressState
Get-DhcpServerv4ScopeStatistics # how full is each scope?
A 5-minute “can’t connect” routine
Resolve-DnsName name– does the name resolve? To the right IP?Test-NetConnection 10.0.0.25 -Port 443– is the port reachable? (TcpTestSucceeded)- If the name fails but the IP works → it’s DNS. Check the record and the client’s DNS servers.
- If the client has a
169.254.x.xaddress → it never got a DHCP lease. Check the scope isn’t full and the relay is configured. - If it works from one PC but not another → compare their DNS servers and clear the cache.
FAQ
I changed a record but users still reach the old server. Why? Caching. The old answer lives in client and server caches until its TTL expires. Clear caches you control and wait out the rest.
Should every server have a PTR record? It’s good practice. Some tools and security checks rely on reverse lookups.
What’s next
Next: Group Policy – create, link and troubleshoot.
Practise this topic
Test yourself with free questions on this topic – instant answers and explanations.
Start practice questionsDNSDHCPWindows ServerNetworkingTroubleshooting