When a Windows XP system is installed with Sysprep it enables by default Dynamic DNS registration. This post explains how to disable the DDNS automatically both at global level and individually for each network interface. Useful for IBM Tivoli TPMfOSd based installations or similar.
According to Microsoft KB article #890210 it is possible to disable DDNS globally through a registry patch:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters\DisableDynamicUpdate

I created the above DWORD registry patch with value 0×1 on a IBM Tivoli TPMfOSd server. I deployed a sysprep‘ed Windows XP image on a target system.

Observations:

  • There was no DDNS error in the System Event Log (previously there was)
  • The checkbox for DDNS registration remains checked (in the registry this is reflected by RegistrationEnabled key, which is specific to a network interface and not a global entry).
  • I checked that the dnsapi.dll is newer than the version mentioned in the above MS KB article

NB: I found information that suggests to set the above in the domain controller’s group policy. But even this method may have problems, as stated in Microsoft KB article #834440 which contains a VB script that should do it definitely?

I tried the above KB’s VB script but it fails because it has never been actually tested, the bug is that big. What a respect from MS. I installed the following VB script as software package on a IBM Tivoli TPMfOSd server, the execution being with
%SystemRoot%\system32\wscript.exe /B /Nologo /T:10 \install\DisableDDNS_Registration.vbs"

'On Error Resume Next

' Set below according to the required policy
Const FULL_DNS_REGISTRATION =False
Const DOMAIN_DNS_REGISTRATION = False
Const ForWriting = 2

Dim objFSO, objCreatedFile, objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objCreatedFile = objFSO.CreateTextFile("C:\Temp\DisableDDNS_RegistrationLog.txt", True)
objCreatedFile.Close
Set objFile = objFSO.OpenTextFile("C:\Temp\DisableDDNS_RegistrationLog.txt", ForWriting, True)
objFile.Writeline("DisableDDNS_Registration.vbs running (see MS KB http://support.microsoft.com/?id=834440)")
objFile.Writeline Now
objFile.Writeline("Full DNS Registration = " & FULL_DNS_REGISTRATION)
objFile.Writeline("Domain DNS Registration = " & DOMAIN_DNS_REGISTRATION)

Cnt = 1

strComputer = "."
Set objWMILocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMICimService = objWMILocator.ConnectServer(strComputer, "root\cimv2")
Set colOS = objWMICimService.ExecQuery("Select * from Win32_OperatingSystem")

For Each objOS in colOS
    if ( InStr(1, objOS.Caption, "XP", vbTextCompare) <= 0 ) Then
        objFile.Writeline ("ERROR, this is not a Windows XP system?")
        objFile.Writeline Now
        objFile.Close
        Wscript.Quit

    End if        

Next

Set colNetCards = objWMICimService.ExecQuery  ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

For Each objNetCard in colNetCards
    retVal = objNetCard.SetDynamicDNSRegistration (FULL_DNS_REGISTRATION, DOMAIN_DNS_REGISTRATION)

    if retVal <> 0 then

        Exit For

    End if

    objFile.Writeline("Controller: " & Cnt)
    Cnt = Cnt + 1

Next

if retVal <> 0 then
    objFile.Writeline ("Error Setting Dynamic DNS Registration.Error Number: "  & retVal)
Else
    objFile.Writeline ("Successfully Changed the required settings!")

End if

objFile.Write("Done: ")
objFile.Writeline Now
objFile.Close

Wscript.Quit

Using the above two methods, the DDNS registration are definitely disabled. Probably the most elegant method would be using the Active Directory to disable DDNS but I interpreted the above MS KB articles so that it is not very reliable.