Windows DNS server in depth: zones, records and forwarders

Ask any Windows admin and they’ll tell you most “AD is broken” tickets end up being DNS. A good Windows DNS server setup is what lets computers find their DCs, lets people reach file servers by name and keeps the internet working from inside the network.

You’ll start by looking inside the zones DC01 created, then add a reverse zone and create A, CNAME and PTR records. After that you’ll check the forwarders on both DCs, switch on scavenging and work through name resolution problems one step at a time.

TimeYou needBy the end you can
About 75 minutesDC01, DC02, SRV01 and CL01 from Lesson 13 (start from the “Domain joined” snapshots if you like)Read and manage DNS zones and records with PowerShell, explain forwarders and conditional forwarders, and fix stale or failing lookups

What it is, in one line

A Windows DNS server is the Windows Server role that answers “what’s the address of this name?” on your network. It stores your domain’s records and asks the internet about everything else.

In Simple Words

The office phone directory

Most offices keep a phone directory at reception. Ask for “Priya in Finance” and the receptionist reads out her extension; ask for a number outside the company and she calls the city directory for you and remembers the answer for a while. DNS is that receptionist, with your zones as the office directory, forwarders as the city directory and the cache as her memory. A reverse zone is the same book sorted by number, so you can ask “whose extension is 220?”

When reception’s memory is out of date, you keep getting the old number until it forgets. That’s the DNS surprise people hit most often, and today you’ll cause it on purpose.

Engineer's View

Zones, records, forwarding and caching

Zones: an AD-integrated zone lives inside AD (in the DomainDnsZones or ForestDnsZones partition) and replicates along with it, so any DC running DNS can accept updates. Standard primary and secondary zones keep their records in files and use zone transfers instead, and a stub zone holds only the NS and SOA records of another zone.

Records: A and AAAA (name to IPv4 and IPv6), CNAME (alias), PTR (address to name, kept in a reverse zone such as 0.0.10.in-addr.arpa), MX (mail), SRV (services such as _ldap._tcp) and NS/SOA. Each record carries a TTL that tells resolvers how long they may cache it.

Dynamic updates: members register their own A records, plus PTR records once a reverse zone exists. With “Secure only”, a record can be changed only by the computer that created it.

Aging and scavenging clean out dynamic records that haven’t been refreshed. Records you create by hand are static, carry no timestamp and never get scavenged.

Recursion: for names it isn’t authoritative for, the server goes to its forwarders (other resolvers, such as 1.1.1.1), or to the root hints if it has none. A conditional forwarder sends one domain, a partner’s for example, to particular servers. Forwarders are saved per server and not in AD, so you have to check each DC.

How it works, step by step

This is what happens when CL01 asks for www.microsoft.com, and when it asks for files.saatlab.internal:

Windows DNS server: how a client resolves a name through cache, DC01 and a forwarder

CL01 looks in its own cache and hosts file first and then asks its DNS server, DC01. If DC01 owns the name it answers from the zone; if it asked recently it answers from cache; otherwise it forwards the question and caches the reply for the record’s TTL.

Here are the zones and records you’ll be working with on DC01:

Windows DNS server zones on DC01: forward, reverse, _msdcs and forwarders
  1. Look at the zones and records DC01 created during promotion.
  2. Add a reverse zone so addresses resolve back to names.
  3. Create records by hand: an A record and a CNAME alias.
  4. Check that DC02 has the same records, and the same forwarders.
  5. Maintain: turn on aging and scavenging so dead records disappear.
  6. Troubleshoot with Resolve-DnsName, nslookup and both caches.

Hands-on Lab: Windows DNS server zones and records on DC01

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Start DC01, DC02 and CL01. With 8 GB of memory, start only DC01 and CL01 and bring DC02 up for step 5. Sign in to DC01 as SAATLAB\Administrator and open PowerShell as administrator; DCs already have the DnsServer module installed.

1See the zones promotion created

On DC01, run this:

Get-DnsServerZone | Select-Object ZoneName, ZoneType, IsDsIntegrated, IsReverseLookupZone

You should see something like this:

ZoneName                ZoneType IsDsIntegrated IsReverseLookupZone
--------                -------- -------------- -------------------
_msdcs.saatlab.internal Primary  True           False
0.in-addr.arpa          Primary  False          True
127.in-addr.arpa        Primary  False          True
255.in-addr.arpa        Primary  False          True
saatlab.internal        Primary  True           False
TrustAnchors            Primary  True           False

saatlab.internal holds your domain’s records and _msdcs.saatlab.internal holds the forest-wide DC records, and both are AD-integrated. The three small reverse zones come built in and stop pointless queries for addresses like 127.0.0.1 from leaving your network.

✅ Checkpoint: Both saatlab zones show IsDsIntegrated True. There is no reverse zone for 10.0.0.x yet.

2List the A records

On DC01, run this:

Get-DnsServerResourceRecord -ZoneName saatlab.internal -RRType A |
    Select-Object HostName, @{n='IP';e={$_.RecordData.IPv4Address}}, Timestamp

You should see something like this:

HostName       IP         Timestamp
--------       --         ---------
@              10.0.0.10  19/10/2026 15:00:00
@              10.0.0.11  19/10/2026 16:00:00
CL01           10.0.0.100 19/10/2026 16:00:00
DC01           10.0.0.10
DC02           10.0.0.11
DomainDnsZones 10.0.0.10  19/10/2026 15:00:00
DomainDnsZones 10.0.0.11  19/10/2026 16:00:00
ForestDnsZones 10.0.0.10  19/10/2026 15:00:00
ForestDnsZones 10.0.0.11  19/10/2026 16:00:00
SRV01          10.0.0.20  19/10/2026 16:00:00

Records with a timestamp were registered dynamically and can age, while records with an empty timestamp are static. @ stands for the zone name itself, which is why saatlab.internal resolves to both DCs.

✅ Checkpoint: You can see SRV01, CL01, DC01 and DC02 with the addresses from your lab plan.

3Add a reverse lookup zone

On DC01, run this:

Add-DnsServerPrimaryZone -NetworkId '10.0.0.0/24' -ReplicationScope Domain -DynamicUpdate Secure
Get-DnsServerZone 0.0.10.in-addr.arpa | Select-Object ZoneName, IsDsIntegrated, DynamicUpdate

You should see something like this:

ZoneName            IsDsIntegrated DynamicUpdate
--------            -------------- -------------
0.0.10.in-addr.arpa True           Secure

A reverse zone’s name is the network part written backwards. Computers add their own PTR records the next time they register, and you can hurry that along with ipconfig /registerdns on SRV01, CL01 and DC01.

Give it a minute, then run this on DC01:

Resolve-DnsName 10.0.0.20 | Select-Object Name, NameHost

You should see something like this:

Name                    NameHost
----                    --------
20.0.0.10.in-addr.arpa  SRV01.saatlab.internal

✅ Checkpoint: 10.0.0.20 resolves back to SRV01.saatlab.internal.

4Create an A record and a CNAME

The intranet site you’ll build in Lesson 25 runs on SRV01, and people should reach shares through a name that stays the same when servers change. Create both records:

On DC01, run this:

Add-DnsServerResourceRecordA -ZoneName saatlab.internal -Name intranet -IPv4Address 10.0.0.20
Add-DnsServerResourceRecordCName -ZoneName saatlab.internal -Name files -HostNameAlias SRV01.saatlab.internal
Resolve-DnsName files.saatlab.internal | Select-Object Name, Type, NameHost, IPAddress

You should see something like this:

Name                   Type  NameHost               IPAddress
----                   ----  --------               ---------
files.saatlab.internal CNAME SRV01.saatlab.internal
SRV01.saatlab.internal A                            10.0.0.20

The CNAME answer arrives in one reply together with the A record of its target. When SRV01 gets replaced you change one CNAME, and every shortcut and mapped drive that uses files carries on working.

✅ Checkpoint: files.saatlab.internal resolves through a CNAME to 10.0.0.20.

Windows DNS server lab: CNAME and PTR lookups with Resolve-DnsName
The alias files points to SRV01, and 10.0.0.20 resolves back to SRV01 through the new reverse zone.

5Check DC02: records replicate, forwarders don’t

Start DC02 if it isn’t running. On DC01, run this:

Get-DnsServerResourceRecord -ZoneName saatlab.internal -Name intranet -ComputerName DC02 | Select-Object HostName, RecordType
Get-DnsServerForwarder -ComputerName DC01 | Select-Object IPAddress
Get-DnsServerForwarder -ComputerName DC02 | Select-Object IPAddress

You should see something like this:

HostName RecordType
-------- ----------
intranet A

IPAddress
---------
{1.1.1.1}

IPAddress
---------
{}

The record you made on DC01 shows up on DC02 because the zone lives in AD. Forwarders are kept in each server’s own settings, though, so DC02’s list may be empty or different. If DC02 has no forwarder, add one so both DCs answer internet names the same way:

On DC01, run this:

Add-DnsServerForwarder -IPAddress 1.1.1.1 -ComputerName DC02
Resolve-DnsName www.microsoft.com -Server 10.0.0.11 -Type A | Select-Object -First 1 Name, Type

✅ Checkpoint: DC02 has the intranet record and 1.1.1.1 as its forwarder, and it resolves www.microsoft.com.

6Turn on aging and scavenging

Laptops come and go, and the records they leave behind stay there unless something cleans them up. Turn on aging for the zone and scavenging on one DC only (DC01), so you always know where the cleanup runs:

On DC01, run this:

Set-DnsServerZoneAging -Name saatlab.internal -Aging $true -NoRefreshInterval 7.00:00:00 -RefreshInterval 7.00:00:00
Set-DnsServerScavenging -ScavengingState $true -ScavengingInterval 7.00:00:00
Get-DnsServerZoneAging -Name saatlab.internal | Select-Object ZoneName, AgingEnabled, NoRefreshInterval, RefreshInterval

You should see something like this:

ZoneName         AgingEnabled NoRefreshInterval RefreshInterval
--------         ------------ ----------------- ---------------
saatlab.internal True         7.00:00:00        7.00:00:00

Now a dynamic record that hasn’t been refreshed for 14 days (no-refresh plus refresh) can be removed. Computers that are still in use refresh their records every day, so only the dead ones go, and static records like intranet are left alone.

✅ Checkpoint: Aging is True on saatlab.internal and scavenging is on for DC01.

7Troubleshoot a lookup the methodical way

When a name won’t resolve, start at the client and work outwards. On CL01, in PowerShell:

Run these one at a time:

Get-DnsClientServerAddress -InterfaceAlias Ethernet -AddressFamily IPv4 | Select-Object ServerAddresses
Get-Content C:\Windows\System32\drivers\etc\hosts | Select-String -NotMatch '^\s*#'
Resolve-DnsName intranet.saatlab.internal
Resolve-DnsName intranet.saatlab.internal -Server 10.0.0.11 -DnsOnly
nslookup intranet.saatlab.internal

Taken in order, they tell you which DNS servers the client uses, whether a hosts file entry is overriding DNS, what normal resolution returns, what a particular DC returns when asked directly, and what nslookup says. Because nslookup always goes to the DNS server and ignores both the hosts file and the client cache, it sometimes disagrees with what applications see.

✅ Checkpoint: All three lookups return 10.0.0.20, and the hosts file has no active entries.

Break It, Then Fix It

These are two DNS tickets you’ll see again and again: “I changed the record but people still go to the old server”, and “the internet stopped working but internal names are fine”.

1Break it: a change that doesn’t show up

On DC01, create a record with a long TTL pointing at the wrong server:

Add-DnsServerResourceRecordA -ZoneName saatlab.internal -Name app -IPv4Address 10.0.0.10 -TimeToLive 01:00:00

On CL01, look it up once, so it gets cached:

Resolve-DnsName app.saatlab.internal | Select-Object Name, IPAddress, TTL

Now on DC01, “fix” the record to point at SRV01:

Remove-DnsServerResourceRecord -ZoneName saatlab.internal -Name app -RRType A -Force
Add-DnsServerResourceRecordA -ZoneName saatlab.internal -Name app -IPv4Address 10.0.0.20 -TimeToLive 01:00:00

Back on CL01, look it up again:

Resolve-DnsName app.saatlab.internal | Select-Object Name, IPAddress, TTL

You’ll see the old answer, something like this:

Name                 IPAddress  TTL
----                 ---------  ---
app.saatlab.internal 10.0.0.10 3412

The server has the right answer; it’s the client that’s remembering the old one. CL01 cached the first reply for its TTL of one hour and won’t ask again until that runs out. That’s why big DNS changes get planned: you lower the TTL a day ahead and then make the change.

To fix it, clear the client cache (and the server cache too, if the server had cached the answer):

Clear-DnsClientCache                          # on CL01
Resolve-DnsName app.saatlab.internal | Select-Object Name, IPAddress, TTL

You should see something like this:

Name                 IPAddress  TTL
----                 ---------  ---
app.saatlab.internal 10.0.0.20 3600

On a real network you can’t clear every laptop’s cache, so you wait for the TTL to run out. Clear-DnsServerCache on a DNS server helps when the stale answer came from another server’s zone.

✅ Checkpoint: CL01 showed 10.0.0.10 after the change, and 10.0.0.20 after clearing its cache.

2Break it: forwarders that don’t answer

On DC01, swap the forwarder for an address where nothing is listening, and turn off the fallback to root hints:

Set-DnsServerForwarder -IPAddress 10.0.0.99 -UseRootHint $false
Clear-DnsServerCache -Force
Resolve-DnsName www.microsoft.com -Server 10.0.0.10 -DnsOnly

You’ll get an error like this:

Resolve-DnsName : www.microsoft.com : DNS server failure
At line:1 char:1
+ Resolve-DnsName www.microsoft.com -Server 10.0.0.10 -DnsOnly
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (www.microsoft.com:String) [Resolve-DnsName], Win32Exception
    + FullyQualifiedErrorId : RCODE_SERVER_FAILURE,Microsoft.DnsClient.Commands.ResolveDnsName

Internal names keep working because DC01 owns those zones, but anything outside fails since DC01 has nobody left to ask. Depending on timing you may get a timeout message instead, and the cause is the same.

To fix it, put the real forwarder back with root hints as the fallback:

Set-DnsServerForwarder -IPAddress 1.1.1.1 -UseRootHint $true
Resolve-DnsName www.microsoft.com -Server 10.0.0.10 -DnsOnly | Select-Object -First 1 Name, Type

Clean up the test record with Remove-DnsServerResourceRecord -ZoneName saatlab.internal -Name app -RRType A -Force.

✅ Checkpoint: External names failed with a dead forwarder and work again with 1.1.1.1.

Windows DNS server lab: stale cached record and DNS server failure from a dead forwarder
Both faults: CL01 still holds the old cached answer, and DC01 fails outside names when its forwarder is dead.

This happened at work

The hosts file nobody remembered

A payroll application was moved to a new database server over a weekend. The DNS record was updated, the old server was switched off, and on Monday everyone was fine except the payroll team, whose report server kept saying the database couldn’t be reached. DNS looked perfect, and nslookup on the report server gave the new address, yet the application kept trying the old one.

It took a while to find. Two years earlier, during another migration, someone had put the database name in the report server’s hosts file “temporarily”. Applications use the hosts file before DNS but nslookup ignores it, so every test the team ran looked fine. The fix: they removed the entry and made Resolve-DnsName (which follows the same rules as applications) the standard test, and a monthly script now reports any active hosts file entries on servers.

The lesson: when DNS looks right and the app still disagrees, look at the client: its hosts file, its cache and the DNS servers it’s using.

Common mistakes and troubleshooting

Mistake or symptomWhat happensWhat to do instead
Members or DCs pointing at public DNSInternal names and DC lookups failClients use only internal DNS servers; DCs forward outwards
Changing a record and expecting instant resultsClients keep the old answer until the TTL runs outLower the TTL in advance; Clear-DnsClientCache for testing
Testing only with nslookupIt ignores the hosts file and client cacheUse Resolve-DnsName, which behaves like applications
Forwarders set on one DC onlyInternet lookups behave differently depending on the DCCheck Get-DnsServerForwarder on every DNS server
No reverse zoneTools show addresses instead of names; some apps complainCreate the reverse zone; let members register PTRs
Turning on scavenging with tiny intervalsRecords of machines that were briefly off are deletedUse 7 + 7 days or longer; scavenge on one server
“DNS server failure” for internet names onlyThe forwarder is down or blockedTest the forwarder; keep root hints as a fallback
Hand-made records for computers that register themselvesDuplicates and conflicts when the address changesLet dynamic updates handle members; static records for services
Deleting the _msdcs zone or SRV recordsDCs can’t be found; joins and sign-ins failRestore them, or run nltest /dsregdns on the DC

Interview questions

Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. Can you explain in simple words the difference between an A record and a CNAME?

Why they ask this: These are the most basic DNS records and you’ll create them all the time, so they want to be sure you know them.

How you might answer: An A record points a name straight at an IPv4 address, while a CNAME points a name at another name, which then resolves through its own A record. So a CNAME is a bit like a nickname that leads you to the real name.

2. What is a reverse lookup zone, and when would you actually need one?

Why they ask this: They want to know you understand PTR records and that DNS can work in both directions.

How you might answer: It maps IP addresses back to names using PTR records, and for addresses like 10.0.0.x the zone is called 0.0.10.in-addr.arpa. You need it when logs or tools only show you an IP and you want to know which machine that is.

3. A colleague set a domain PC to use 8.8.8.8 for DNS. Why is that a problem?

Why they ask this: They want to see that you connect DNS with Active Directory and can explain why internal DNS matters.

How you might answer: Clients find domain controllers through SRV records in the AD zones, and a public resolver doesn’t have those. So with 8.8.8.8 the PC can’t find a DC, and sign-in and Group Policy start breaking. Domain members should always use the DCs for DNS.

2–5 years experience

4. You moved an app to a new server and changed the DNS record, but some users still reach the old server. What’s going on, and what would you do?

Why they ask this: They’re checking that you understand TTL and caching and plan your changes around them.

How you might answer: Their resolvers have cached the old record and will hold on to it until the TTL runs out. I’d check the TTL with Resolve-DnsName and clear caches where I can, and next time I’d lower the TTL well before the change so the switch happens faster.

5. How would you explain forwarders, conditional forwarders and root hints to a new team member?

Why they ask this: They want to see that you know the different ways a DNS server can find names it doesn’t host.

How you might answer: A forwarder sends every name we don’t host to resolvers we pick. A conditional forwarder sends only one domain, say a partner’s, to particular servers. And when no forwarder is used, root hints let the server find names on its own, starting from the root servers.

6. Your DNS zone is full of old records for machines that left years ago. How do aging and scavenging help, and how do you turn them on safely?

Why they ask this: A careless scavenging setup can delete live records, so they want to hear that you’ve done it carefully.

How you might answer: Dynamic records carry a timestamp, and if one isn’t updated within the no-refresh plus refresh intervals, scavenging deletes it. I’d turn on aging for the zone and scavenging on one server only, with generous intervals so nothing live gets removed.

Senior level

7. Your company has its own AD, a partner network and a cloud tenant. How would you design DNS so everyone can resolve the right names?

Why they ask this: They want to see that you think about name resolution end to end, across different networks.

How you might answer: I’d keep AD-integrated zones on the DCs, point every client at the DCs and have the DCs forward internet names to a secure resolver. For the partner and the cloud private zones I’d use conditional forwarders or stub zones, and where internal and external answers have to differ I’d use split-brain zones.

8. Only some users complain that name resolution is slow. Everyone else is fine. How do you investigate?

Why they ask this: They want to see a structured way of troubleshooting, starting from what the affected users have in common.

How you might answer: I’d first work out what those users have in common, like the same DNS server, the same site or the VPN. Then I’d test with Resolve-DnsName against each DNS server and see how quickly the forwarders reply. If that doesn’t show it, I’d go through the DNS server event log and the analytic log and take packet captures.

9. How would you protect your company’s DNS servers from abuse and tampering?

Why they ask this: They want to know which DNS security options you know and how you would combine them.

How you might answer: I’d allow secure dynamic updates only, block open recursion to the internet and turn on response rate limiting, with DNSSEC and DNS policies where they’re needed. I’d also restrict zone transfers and keep watching the DNS audit and analytic logs.

Quick quiz

Q1. Where is an AD-integrated zone stored?

  1. In a text file on one server
  2. In Active Directory, replicated with it
  3. In the client cache
Show answer

B — That’s why DC02 had the record you made on DC01.

Q2. Why did CL01 keep getting 10.0.0.10 after you changed the record?

  1. Replication failed
  2. CL01 cached the answer for its TTL
  3. The zone was read-only
Show answer

B — Clear-DnsClientCache or wait for the TTL.

Q3. Which tool ignores the hosts file?

  1. Resolve-DnsName
  2. nslookup
  3. ping
Show answer

B — nslookup always asks the DNS server directly.

Q4. Which of these is NOT stored in AD with the zone?

  1. A records
  2. Forwarders
  3. CNAME records
Show answer

B — Forwarders are per-server settings.

Q5. In the work story, why did every DNS test look fine?

  1. DNS was cached
  2. nslookup ignored the hosts file entry
  3. The server was offline
Show answer

B — The app used the hosts file; nslookup didn’t.

Quick recap

  • A Windows DNS server on your DCs holds AD-integrated zones that replicate with AD.
  • Know your records: A, CNAME, PTR, SRV, MX, and the TTL on each.
  • A reverse zone (0.0.10.in-addr.arpa) lets addresses resolve to names.
  • Forwarders are per server; check them on every DC.
  • Aging and scavenging remove dead dynamic records; static records stay.
  • Troubleshoot from the client out: DNS servers, hosts file, cache, then the server, with Resolve-DnsName.

Next lesson

Lesson 15: DHCP → You’ll install DHCP on SRV01, authorise it in AD, create a scope with options and reservations, move CL01 from its fixed address to DHCP, and set up DHCP failover.

Further reading: Windows DNS server

Want to go further with Windows DNS server? Microsoft’s Implement Windows Server DNS module covers zones and records, and the DNS server troubleshooting guide walks through common faults. The full plan for this course is on the Windows Server Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.