Aracılığıyla paylaş


DNS güncelleştirmeleri zaman aşımına uğradıklarında Olay Kimlikleri 4016 ve 4004

Not

Bu makalede, Windows Server 2019 ve sonraki sürümleri için aşağıdaki düzeltmelerde düzeltilen bir sorun açıklanmaktadır:

Bu makale, Basit Dizin Erişim Protokolü'nden (LDAP) Active Directory'ye (AD) DNS güncelleştirmeleri zaman aşımına uğradıklarında, Olay Kimlikleri 4016 ve 4004'ün Etki Alanı Adı Sistemi'nde (DNS) günlüğe kaydedilmesi sorununu çözmeye yardımcı olur.

Etki alanı denetleyicilerinde barındırılan AD ile tümleşik DNS bölgelerinde (Windows Server 2012 R2 veya sonraki sürümler), DNS bölgeleri numaralandıramaz veya aralıklı olarak kayıt oluşturamaz veya yazamaz. Ayrıca, Olay Kimlikleri 4016 ve 4004 DNS olay günlüğüne kaydedilir:

  • Olay Kimliği 4016

      LogName:       DNS Server
      Source:        Microsoft-Windows-DNS-Server-Service
      Date:          <DateTime>
      Event ID:      4016
      Task Category:
      Level:         Error
      User:          S-1-5-18
      Computer:      Contoso.com
      Description:
      The DNS server timed out attempting an Active Directory service operation on DC=xx.x,DC=xxx.xx.in-addr.arpa,cn=MicrosoftDNS,DC=ForestDnsZones,DC=xxx,DC=com. Check Active Directory to see that it is functioning properly. The event data contains the error.
    
  • Olay Kimliği 4004

      LogName:       DNS Server
      Source:        Microsoft-Windows-DNS-Server-Service
      Date:          <DateTime>
      Event ID:      4004
      Task Category:
      Level:         Error
      User:          S-1-5-18
      Computer:      Contoso.com
      Description:
      The DNS server was unable to complete directory service enumeration of zone xx.xxx.xx.in-addr.arpa.  This DNS server is configured to use information obtained from Active Directory for this zone and is unable to load the zone without it. Check that the Active Directory is functioning properly and repeat enumeration of the zone. The extended error debug information (which may be empty) is "". The event data contains the error.
    

Olay Kimlikleri 4016 ve 4004 günlüğe kaydedilirse, DNS kayıtları diğer etki alanı denetleyicilerinde güncelleştirilir ve ADSI Düzenleme (adsiedit.msc) içinde görünür. Ancak, kayıtlar yazılamaz ve DNS sunucusu hizmeti yeniden başlatılana kadar DNS güncelleştirmeleri durur. Bu süre boyunca, sorunlu etki alanı denetleyicilerinde ADSI Düzenleme kullanılarak kayıtlar aynı anda oluşturulabilir. Bu kayıtlar daha sonra tüm etki alanı denetleyicilerine çoğaltılır ve bu da AD'nin düzgün çalıştığı anlamına gelir. dns.exe işleminin bellek kullanımı düşük. Bu arada, etki alanı denetleyicilerindeki CPU ve bellek kullanımı da düşüktür, ancak yanıt vermemeye devam eder.

DNS denetim günlüklerini, olay günlüklerini ve paket yakalamalarını denetleyerek DNS sorguları hızla yanıtlanmış olsa bile DNS güncelleştirmeleri sunucuda durur. Ayrıca hata 0x55 günlüğe kaydedilir.

DNS Sunucusu hizmetini yeniden başlatın ve Kerberos anahtar önbelleğini silin

Bu sorunu geçici olarak çözmek için Bir Windows PowerShell betiği kullanarak Kerberos anahtar önbelleğini sildikten sonra DNS Sunucusu hizmetini yeniden başlatın. Bir örnek için aşağıdaki betiği inceleyin:

Not

Varsayılan $EventIntervalMinutes ve $NumberOfEvents değerler en uygun değer olmadığından, değerleri buna göre ayarlayın.

    #NOTE: 
# The following two parameters should be adjusted according to your environment.
# The current values are only defaults and may not be optimal for you.

# How long to wait to ensure the 4016 event occurs consistently (that is, not one-offs)
[int]$EventIntervalMinutes=3

# Number of events within $EventIntervalMinutes to indicate we're in an error state
[int]$NumberOfEvents=10

# Monitor forever
while ($True)
{
	# Detect $NumberOfEvents for 4016 or 4011 occurred in the past $EventIntervalMinutes.
	$EntryType = @("Error","Warning")
	$Events = Get-EventLog -LogName 'DNS Server' -After ((get-date).AddMinutes(-$($EventIntervalMinutes))) -EntryType $EntryType

	[int]$NumEvents=0
	[int]$ErrorStateFound=0
	foreach($Event in $Events)
	{
		 if(($Event.InstanceId -eq "4016") -or ($Event.InstanceId -eq "4011"))
		 {
		   $NumEvents += 1;
		 }
	}

	if($NumEvents -ge $NumberOfEvents)
	{
		$ErrorStateFound=1
		"Detected DNS Event ID 4016 and/or 4011 within the past '$($EventIntervalMinutes)' minutes.  Take mitigation actions."  *>> C:\temp\dnsResetLog.txt

		# Stop DNS
		"`n`nStop DNS at $(Get-Date)" *>> C:\temp\dnsResetLog.txt
		Stop-Service DNS -Force *>> C:\temp\dnsResetLog.txt

		do { Start-Sleep 1 } until ((Get-Service DNS).Status -ne "Running")

		# Purge tickets 
		"`nPurge system tickets at $(Get-Date)" *>> C:\temp\dnsResetLog.txt
		klist purge -li 0x3e7 *>> C:\temp\dnsResetLog.txt

		# Start DNS
		"`nStart DNS at $(Get-Date)" *>> C:\temp\dnsResetLog.txt
		Start-Service DNS *>> C:\temp\dnsResetLog.txt

		# Record DNS Server process details to a file
		Get-Process dns | Select-Object Name, Id, StartTime | Format-List | Out-String *>> C:\temp\dnsResetLog.txt

		"`nEnd at $(Get-Date)" *>> C:\temp\dnsResetLog.txt
	}

	if ($ErrorStateFound)
	{
		# Don't loop again until waiting long enough to ensure no new events after restarting the service
		# Otherwise, we'll keep restarting!
		"`n`Sleeping for ($EventIntervalMinutes+1) minutes" *>> C:\temp\dnsResetLog.txt
		Start-Sleep -seconds (60*($EventIntervalMinutes+1))
		"`n`n Starting new monitoring cycle at $(Get-Date)" *>> C:\temp\dnsResetLog.txt
	}
	else{
		# Give a 1-minute pause before checking again
		Start-Sleep -seconds 60
	}
}