Skip to content

KRB_AP_ERR_SKEW: domain clock drift locks users out

  • Home
  • Blog
  • KRB_AP_ERR_SKEW: domain clock drift locks users out
KRB_AP_ERR_SKEW: domain clock drift locks users out
Short answer

If users suddenly cannot sign in or reach file shares, and the logs show KRB_AP_ERR_SKEW (Kerberos error code 37, “Clock skew too great”) or “There is a time and/or date difference between the client and server”, the cause is most likely domain clock drift. By default, Kerberos tolerates at most a 5-minute difference between a client and the domain controller. The permanent fix is to point the PDC emulator in the forest root at reliable external NTP sources and to disable hypervisor time synchronization on virtual DCs.

Symptoms: “There is a time and/or date difference between the client and server”

  • Users get authentication errors when signing in, mapping network drives or using printers; the same account works on some computers but not on others.
  • The Windows error text reads: “There is a time and/or date difference between the client and server.” (ERROR_TIME_SKEW, 1398 / 0x576).
  • Network traces, or the logs of Kerberos-enabled devices such as Linux servers, NAS units or firewalls, show “KRB_AP_ERR_SKEW” or “Clock skew too great”.
  • The domain controllers are minutes ahead of or behind real time, and they also differ from each other.
  • On a virtual DC, w32tm /query /source returns “VM IC Time Synchronization Provider” instead of an external NTP server or another DC.
  • In the cases we encounter in the field at businesses in Denizli, the problem is usually noticed after host maintenance or a virtual machine migration.

Root cause: Kerberos tolerates 5 minutes, and the time hierarchy hangs on a single PDC

Kerberos uses timestamps as part of its protocol to prevent replay attacks. The clocks of the client and the authenticating domain controller therefore have to be close to each other. The allowed difference is set by the “Maximum tolerance for computer clock synchronization” policy; its default in the Default Domain Policy is 5 minutes, and Microsoft recommends keeping it at 5 minutes. RFC 4120 defines that the KRB_AP_ERR_SKEW error (code 37) is returned when the difference exceeds the allowable clock skew.

In an Active Directory forest, time is distributed through a hierarchy. Member computers take time from a DC in their own domain, DCs take it from a more authoritative DC, and DCs in child domains look to the parent domain. At the top of the hierarchy is the DC holding the PDC emulator role in the forest root domain. According to Microsoft, this DC should be configured to synchronize with an external NTP server or hardware clock; if it is not, its internal hardware clock governs the time and the entire forest follows it.

Virtualization silently breaks this chain. The Hyper-V Time synchronization integration service sets the guest operating system’s clock from the host, and in that case w32tm shows “VM IC Time Synchronization Provider” as the source. Microsoft recommends disabling time synchronization between the host and a guest that acts as a DC, so that the DC synchronizes with the domain hierarchy instead. If the PDC emulator follows the host clock and the host clock has drifted, the PDC spreads the wrong time across the whole domain. If some DCs follow the host and others follow the hierarchy, the DCs drift apart, and depending on which DC they hit, some users can sign in while others cannot. For third-party hypervisors such as VMware, Microsoft says to consult the hypervisor’s documentation for time synchronization guidance.

Step-by-step fix

  1. Identify which DC holds the PDC emulator role.
  2. On the PDC, query the time source, status and configuration. If the “Source” line does not show an external NTP server, the problem is here.
  3. Measure the offset between the PDC and the other DCs and an affected client; w32tm /monitor shows the offset of all DCs in the domain at once.
  4. Disable the Time synchronization integration service on every DC virtual machine running on Hyper-V: in Hyper-V Manager, clear Time synchronization under the VM’s Settings > Integration Services, or use Disable-VMIntegrationService in PowerShell. If you use VMware or another hypervisor, disable periodic time synchronization according to the vendor’s documentation.
  5. Point the PDC emulator at reliable external NTP sources and mark it as a reliable time source. Microsoft recommends three or more time servers when you configure multiple peers. Replace the server names in the example with your own reliable NTP sources.
  6. Request an immediate resync and query the status again. Make sure outbound UDP 123 is allowed from the PDC; the Windows Time service uses UDP port 123 for all time synchronization.
  7. Confirm that the other DCs and members use the domain hierarchy rather than a manually specified source; switch them back to domhier if needed.
  8. Once the time is correct, ask affected users to sign out and back in, or restart their computers.
netdom query fsmo

w32tm /query /source
w32tm /query /status
w32tm /query /configuration

w32tm /monitor
w32tm /stripchart /computer:PDC01 /samples:5 /dataonly
# On the Hyper-V host (PowerShell)
Get-VMIntegrationService -VMName "DC01"
Disable-VMIntegrationService -VMName "DC01" -Name "Time Synchronization"
REM Only on the PDC emulator in the forest root
w32tm /config /manualpeerlist:"ntp1.example.com,0x8 ntp2.example.com,0x8 ntp3.example.com,0x8" /syncfromflags:manual /reliable:yes /update
w32tm /resync /rediscover
w32tm /query /status

REM Other DCs and member servers
w32tm /config /syncfromflags:domhier /update
net stop w32time
net start w32time

Configure the external source only on the PDC emulator in the forest root; using /reliable:yes on other DCs breaks the hierarchy. Be careful when the offset is very large: according to Microsoft, MaxPosPhaseCorrection and MaxNegPhaseCorrection default to 172,800 seconds (48 hours) on domain controllers, and if a larger correction is needed the service logs an event instead of correcting the time. In that case you have to bring the clock close manually. Also, if the PDC role moves to another DC, repeat the configuration on the new PDC and switch the old PDC back to domhier.

Permanent prevention

  • Always feed the PDC emulator in the forest root from reliable external NTP sources; all other DCs and members should use the domain hierarchy.
  • Keep host time synchronization disabled on every virtual DC and add it to the checklist for new DC builds.
  • Do not hide the problem by raising the Kerberos tolerance above 5 minutes; Microsoft recommends 5 minutes for this setting.
  • In line with Microsoft’s recommendation, run more than one DC per domain on different hosts and, if possible, keep a physical DC.
  • Monitor the output of w32tm /monitor and the Time-Service events in the System log regularly; by default, Windows Time logs an event every time it switches to a new time source.

When to call an expert

If you have multiple domains or sites, if the offset exceeds 48 hours, if the PDC role has to be moved, or if the problem persists after the time is corrected, one wrong step can stop authentication for every user at once. In Denizli, Workas supports diagnosing the Active Directory time hierarchy, configuring virtual DCs correctly and connecting the PDC emulator to external NTP sources as part of its server and backup solutions service. Our team works Monday to Saturday, 08:00–18:00, and provides priority response in emergencies.

Frequently Asked Questions

Is raising the Kerberos tolerance above 5 minutes a fix?

No. The tolerance protects against replay attacks, and Microsoft recommends 5 minutes. Raising it does not remove the root cause; fix the time hierarchy instead.

Should I disable Hyper-V time synchronization only on the PDC?

No. Microsoft recommends disabling host-to-guest time synchronization on every virtual machine acting as a DC, so that each DC takes its time from the domain hierarchy.

Should PDC emulators in child domains also use external NTP?

No. Only the PDC emulator in the forest root domain is pointed at an external source; DCs in child domains take their time from the domain hierarchy.

If the error only shows up on a Linux server or NAS, is it still the domain clock?

It can be. If the offset between the device and the DC exceeds the allowed skew, KRB_AP_ERR_SKEW is returned. First confirm that the DC time is correct, then point the device’s NTP source at the domain controllers.

Sources

  1. Maximum tolerance for computer clock synchronization – Microsoft Learn
  2. Windows Time Service Tools and Settings – Microsoft Learn
  3. How the Windows Time Service Works – Microsoft Learn
  4. Virtualizing domain controllers with Hyper-V – Microsoft Learn
  5. RFC 4120: The Kerberos Network Authentication Service (V5)

Let's Get Started

Let's Work Together!

Let's plan your company's IT needs together — we'll quickly find the right solution for you.

x

Since 2002, Workas Software Technology has provided businesses in Denizli with ERP, cybersecurity, network, server and backup, custom software and AI solutions.

Address
Kınıklı, Hüseyin Yılmaz Cd. No:67,
B Blok Z06, 20160 Pamukkale/Denizli, Türkiye
Get in Touch
0549 669 99 06
0535 089 29 29
Working Hours
Mon - Sat: 8:00 - 18:00