JSI Tip 7900. DNS problems in a single-label forward lookup zone?

Jerold Schulman

April 1, 2004

2 Min Read
ITPro Today logo in a gray background | ITPro Today

A single-label DNS zone name is one without a period (.). It is also called a top-level domain zone.

Starting with Windows 2000 SP4, Windows does not dynamically register DNS records in a single-label domain.

Windows XP, Windows Server 2003, and Windows 2000 SP4 and later do not send updates to top-level domains.

I have scripted SLDNS.bat to change this behavior.

NOTE: See How do I use Group Policy to Update Top Level Domain Zones?

The syntax for using SLDNS.bat is:

SLDNS [Y]

Where Y is an optional parameter that restarts a modified computer so the change can take effect.

NOTE: I recommend that you run the SLDNS.bat script from a Windows XP client or from Windows Server 2003. If you run from any other client, you will need to replace the Shutdown command with the equivalent PsShutdown command.

NOTE: If NETDOM.EXE and REG.EXE are NOT installed on the computer you will use to run SLDNS.bat, install them from the Support / Tools folder of your O/S CD-ROM.

NOTE: SLDNS.bat writes an error log as SLDNS.LOG in the current folder.

SLDNS.bat contains:

@echo offsetlocalset SD=Nif /i {%1}=={Y} set SD=Yset netdm=netdom query /domain:%userdnsdomain%if exist SLDNS.LOG del /q SLDNS.LOGcall :getcomp>nul 2>&1if "%SD%" EQU "Y" shutdown -r -f -t 121 -c "Close all applications. Your computer will restart is 2 minutes"if not exist SLDNS.LOG endlocal&exit /b 0@echo Unable to determine the version of the following computer names at this time:type SLDNS.LOGendlocalexit /b 0:getcompfor /f "Skip=1 Tokens=*" %%c in ('%netdm% server^|find /v /i "The command completed successfully."') do ( call :gotcomp %%c)for /f "Skip=1 Tokens=*" %%c in ('%netdm% workstation^|find /v /i "The command completed successfully."') do ( call :gotcomp %%c):: Wait Three minutes before processing the first domain controllerif "%SD%" EQU "Y" ping -n 181 127.0.0.1>nulfor /f "Skip=1 Tokens=*" %%c in ('%netdm% dc^|find /v /i "The command completed successfully."') do ( call :wait call :gotcomp %%c)goto :EOF:wait:: Wait three minutes before processing the next domain controllerif "%SD%" EQU "Y" ping -n 181 127.0.0.1>nulgoto :EOF:gotcompset cmp=%1set cv=N/Afor /f "Tokens=2*" %%r in ('reg query "\%cmp%HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v CurrentVersion^|find "REG_SZ"') do set cv=%%sset cv=%cv:~0,3%set sp=N/Afor /f "Tokens=2*" %%r in ('reg query "\%cmp%HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v CSDVersion^|find "REG_SZ"') do set sp=%%sset sp=%sp:,= %set sp=%sp:~0,14%if "%cv%" EQU "N/A" @echo %cmp% %cv% %sp%>>SLDNS.LOG&goto :EOFif "%cv%" LSS "5.0" goto :EOFif "%cv%" EQU "5.0" if "%sp%" EQU "N/A" goto :EOFif "%cv%" EQU "5.0" if "%sp%" LSS "Service Pack 4" goto :EOFreg ADD "\%cmp%HKLMSystemCurrentControlSetServicesNetlogonParameters" /v AllowSingleLabelDnsDomain /t REG_DWORD /d 00000001 /fif "%cv%" GTR "5.1" goto ws2003preg ADD "\%cmp%HKLMSystemCurrentControlSetServicesDnsCacheParameters" /v UpdateTopLevelDomainZones /t REG_DWORD /d 00000001 /fgoto :shut:ws2003preg ADD "\%cmp%HKLMSOFTWAREPoliciesMicrosoftWindows NTDNSClient" /v UpdateTopLevelDomainZones /t REG_DWORD /d 00000001 /f:shutif "%SD%" EQU "N" goto :EOFif /i "%COMPUTERNAME%" EQU "%cmp%" goto :EOFshutdown -r -f -m \%cmp% -t 61 -c "Close all applications. Your computer will restart is 60 seconds"



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like