About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
When the DNS Server log on a domain controller shows event 4016 ("The DNS server timed out attempting an Active Directory service operation") and event 4004 ("The DNS server was unable to complete directory service enumeration of zone"), Microsoft's page describes an issue in which DNS cannot enumerate Active Directory-integrated zones or intermittently fails to create or write records. It names three April 2024 updates that fix the issue, and a workaround for servers that do not have them.
The page says records created with ADSI Edit on the affected domain controller replicate to all domain controllers, "which means the AD is working properly".
What the error means
Microsoft's page is titled "Event IDs 4016 and 4004 when DNS updates time out". It says that in AD-integrated DNS zones hosted on domain controllers running Windows Server 2012 R2 or later, "DNS can't enumerate the zones or intermittently fail to create or write records", and the two events are logged in the DNS Server log.
Event 4016, source Microsoft-Windows-DNS-Server-Service, level Error, reads in part: "The DNS server timed out attempting an Active Directory service operation on" a named zone object, "Check Active Directory to see that it is functioning properly. The event data contains the error."
Event 4004, same source and level, reads in part: "The DNS server was unable to complete directory service enumeration of zone" and says the server is configured to use information from Active Directory for that zone and cannot load it without it.
The page adds what it observed: the DNS records are updated on other domain controllers and visible in ADSI Edit; the records cannot be written on the affected one; and "the DNS updates stop until the DNS Server service is restarted". Records created at the same time with ADSI Edit on the problem domain controllers replicate to all domain controllers, "which means the AD is working properly". The dns.exe process uses little memory, CPU and memory on the domain controllers are low, "but they remain unresponsive". DNS queries are still answered quickly, and "error 0x55 is logged".
Likely causes
The page does not name a root cause beyond the symptom. It records that the issue is "fixed in the following hotfixes for Windows Server 2019 and later versions" and lists them:
| Update | OS build named on the page |
|---|---|
| April 9, 2024, KB5036909 | 20348.2402 |
| April 9, 2024, KB5036910 | 25398.830 |
| April 9, 2024, KB5036896 | 17763.5696 |
The page does not say which Windows Server release each build belongs to, and does not say whether Windows Server 2012 R2 and later versions, which it describes as affected, all have a fix. A domain controller without the matching update is the likely case; the page does not give a way to prove that the update is the cause.
Related: DNS event 4013 and DNS event 4015.
Prove the cause before changing anything
All of these only read.
Confirm the events are on the DNS Server log of a domain controller that hosts AD-integrated zones, and note the times of 4016 and 4004. In PowerShell, Microsoft's
Get-WinEventpage shows-FilterHashtablewithLogNameandIdkeys:Get-WinEvent -FilterHashtable @{ LogName='DNS Server'; Id='4016' } Get-WinEvent -FilterHashtable @{ LogName='DNS Server'; Id='4004' }Compare with another domain controller. The page says records are updated on the other domain controllers and visible in ADSI Edit (
adsiedit.msc), so a record that exists on other domain controllers and is missing or stale on this one fits.Check the update level. The page names three updates and three OS builds. Compare the OS build on the affected domain controller with the builds in the table. The page does not say how to read the build, and only the builds listed are named as fixed.
Check whether DNS updates resume after a DNS Server service restart and stop again later. The page describes that pattern: updates stop until the service is restarted.
Example (illustrative): at contoso.com.au, dc02 shows eleven 4016 events in a 3-minute window and then 4004 for a reverse lookup zone. A new record created with ADSI Edit on dc02 replicates to dc01 and is visible there. Restarting the DNS Server service on dc02 lets dynamic updates through for an hour before the events return. That matches the page's description.
Fix
The page's fix is the update for the operating system build you run. Its note says the issue is "fixed in the following hotfixes" and gives the three update numbers. The page gives no installation steps, so installing one on a domain controller follows your own patching process, with that process's own save-first step and back-out.
The page gives a workaround, which reads as the option for a server you cannot update yet: to "restart the DNS Server service after deleting the Kerberos ticket cache by using a Windows PowerShell script". The page's script monitors the DNS Server log every minute, and when ten or more 4016 or 4011 events occur in three minutes it stops DNS, purges the system tickets with klist purge -li 0x3e7, starts DNS and writes a log to C:\temp\dnsResetLog.txt. The page says its two defaults, $EventIntervalMinutes and $NumberOfEvents, "may not be optimal" and should be adjusted. The script text is on the page. Running it as it stands is not recommended: it loops forever, so it is a standing change, not a one-off, and Microsoft's klist page says you must be at least a Domain Admin, or equivalent, to run all the parameters of the command. If you choose to run it, read all of it first, stop it with Ctrl+C in its PowerShell window (or by ending its PowerShell process), and use the log file to see what it did. Reading it shows three behaviours worth knowing before it runs: after a mitigation it sleeps for $EventIntervalMinutes plus one minute "Otherwise, we'll keep restarting!", as its own comment says; when no error state is found it pauses one minute before checking again; and it writes everything it does, including the DNS process details after the restart, to the log file, so that file is the record of how often the server was restarted. Because the script's trigger counts events inside a window, a single 4016 does not cause a restart, and the page explains that the window exists "to ensure the 4016 event occurs consistently (that is, not one-offs)".
The same three actions can be done by hand once. First, select the tickets you are about to remove. The klist page documents -li as the low part of the user's locally unique identifier (LUID), in hexadecimal, and tickets as the way to list the cached tickets of the specified logon session. The page's script logs this step as "Purge system tickets".
Save first: write the ticket list and the 4016 and 4004 events to files before you change anything. Create the C:\Temp folder first if it is missing:
klist -li 0x3e7 tickets > C:\Temp\system-tickets-before.txt
Get-WinEvent -FilterHashtable @{ LogName='DNS Server'; Id='4016','4004' } | Format-List * > C:\Temp\dns-events-before.txt
Disruptive step: the next commands stop the DNS Server service on a domain controller, purge the Kerberos tickets cached for the system logon session, and start the service again. DNS is unavailable on that server while it is stopped, so clients that use only this server for DNS cannot resolve names during that time. The purge removes every ticket that klist -li 0x3e7 tickets lists, and Microsoft's klist page warns that purging "might stop you from being able to authenticate to resources".
Run these three commands on the domain controller, in order:
Stop-Service DNS -Force
klist purge -li 0x3e7
Start-Service DNS
To undo it: the service restart needs no reversal, because DNS is running again afterwards; if the commands stop partway, run Start-Service DNS. The ticket purge cannot be undone. The klist page says that if purging stops you authenticating, "you'll have to log off and log on again".
Confirm the fix
- No new 4016 or 4004 events appear in the DNS Server log over a full business day. The page's pattern is intermittent, so a quiet hour proves little.
- A record created on the server, by a client updating dynamically or with ADSI Edit, is visible on the other domain controllers and on this one.
- If you installed an update, the build number on the server is one of those named on the page. If it is a later build, the page does not say whether the fix is included, so check the update history of the build you run.
What to watch afterwards
- Event 4016 and 4004 counts after each patch cycle. The page gives its workaround as "To work around this issue"; treat it as a stopgap for servers without the update, which is an inference, not the page's wording.
- Any other server that hosts AD-integrated zones and has not received the update.
- The script's own log file, if you run the page's script, and how often it restarts DNS.
Read next
Related articles you may want next.
- TroubleshootingDNS event 4013 after a restart: why a domain controller takes 15 minutes or more to startA domain controller sits at Preparing network connections for up to 25 minutes and logs DNS event 4013. Find out why DNS and Active Directory are waiting on each other, prove it, then stagger restarts and set the DNS client order so a working DNS server is always reachable.Read article
- TroubleshootingDNS event 4015: "The DNS server has encountered a critical error from the Active Directory"DNS event 4015 on a domain controller: read the extended error code (00002095, 0000051B, ADMIN_LIMIT_EXCEEDED), prove the cause, then fix it.Read article
- TroubleshootingClean Up Stale AD DNS Records: Scavenging Without Deleting Live OnesStale DNS records in an AD-integrated zone? Understand no-refresh and refresh intervals and timestamps, list records by age first, then enable scavenging on one server safely.Read article
Risks and limits
These steps have not been run or lab-tested.
Microsoft's page gives no root cause and no check that tells you the update is what is missing. It names OS builds without naming Windows Server releases, and its fix note covers Windows Server 2019 and later, while the symptom is described for Windows Server 2012 R2 and later. The workaround script restarts DNS automatically, which interrupts name resolution each time it runs. It treats event 4011 as well as 4016, though the page's text describes 4016 and 4004.
Sources
- Event IDs 4016 and 4004 when DNS updates time out — Microsoft Learn, page dated 2026-02-12, accessed 1 December 2026
- klist — Microsoft Learn, page dated 2023-02-03, accessed 1 December 2026
- Get-WinEvent — Microsoft Learn, date not shown, accessed 1 December 2026
This article was originally published on .