Symptoms
- You have deployed a system with Windows Vista or a later operating system listed in the title of this article.
- You are using a Windows answer file generated using the Windows System Image Manager or manually, similar to the one below- to set a Primary DNS Suffix for the machine.
***************************************
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-DNS-Client" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DNSDomain>test.local</DNSDomain>
<UseDomainNameDevolution>true</UseDomainNameDevolution>
<DNSSuffixSearchOrder>
<DomainName wcm:action="add" wcm:keyValue="1">suffix1.test</DomainName>
<DomainName wcm:action="add" wcm:keyValue="2">suffix2.test</DomainName>
</DNSSuffixSearchOrder>
</component>
</settings>
</unattend>
***************************************
- The answer file named Unattend.xml is copied to the directory path "C:\windows\system32\sysprep"
- The following command is run to apply the answer file upon next boot of the system to set the Primary DNS suffix for the machine.
c:\windows\system32\sysprep\sysprep.exe /oobe /generalize /reboot /quiet /unattend:c:\windows\system32\sysprep\unattend.xml - The Primary DNS suffix as indicated by the ipconfig /all output or the System Properties Window is not set as expected.
Cause
This can happen if the system was joined to a Windows domain at some point and may be later removed.
- Joining the machine to the domain causes a string value named "NV Domain" to be created at the registry location HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
- The "NV Domain" registry value is copied into the "Domain" string value at the same registry location at boot by WININIT.EXEon
- The string value "Domain" at registry location "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" holds the Primary DNS suffix value for the machine.
- Therefore, depending on the value of string value "NV Domain" as above will dictate the Primary DNS suffix upon boot after the sysprep command.
Resolution
- Ensure that the answer file is being applied to a system that was never joined to the domain prior to running sysprep.
- The second option is to delete the "NV Domain" value from "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" prior to running sysprep.
More Information
Reference the help files that come with the Windows Automated Installation kit for details on answer files and Sysprep.