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

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:


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 off
set SD=N
if /i \{%1\}==\{Y\} set SD=Y
set netdm=netdom query /domain:%userdnsdomain%
if exist SLDNS.LOG del /q SLDNS.LOG
call :getcomp>nul 2>&1
if "%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:
exit /b 0
for /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 controller
if "%SD%" EQU "Y" ping -n 181>nul
for /f "Skip=1 Tokens=*" %%c in ('%netdm% dc^|find /v /i "The command completed successfully."') do (
 call :wait
 call :gotcomp %%c
goto :EOF
:: Wait three minutes before processing the next domain controller
if "%SD%" EQU "Y" ping -n 181>nul
goto :EOF
set cmp=%1
set cv=N/A
for /f "Tokens=2*" %%r in ('reg query "\\%cmp%\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion^|find "REG_SZ"') do set cv=%%s
set cv=%cv:~0,3%
set sp=N/A
for /f "Tokens=2*" %%r in ('reg query "\\%cmp%\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDVersion^|find "REG_SZ"') do set sp=%%s
set sp=%sp:,= %
set sp=%sp:~0,14%
if "%cv%" EQU "N/A" @echo %cmp% %cv% %sp%>>SLDNS.LOG&goto :EOF
if "%cv%" LSS "5.0" goto :EOF
if "%cv%" EQU "5.0" if "%sp%" EQU "N/A" goto :EOF
if "%cv%" EQU "5.0" if "%sp%" LSS "Service Pack 4" goto :EOF
reg ADD "\\%cmp%\HKLM\System\CurrentControlSet\Services\Netlogon\Parameters" /v AllowSingleLabelDnsDomain /t REG_DWORD /d 00000001 /f
if "%cv%" GTR "5.1" goto ws2003p
reg ADD "\\%cmp%\HKLM\System\CurrentControlSet\Services\DnsCache\Parameters" /v UpdateTopLevelDomainZones /t REG_DWORD /d 00000001 /f
goto :shut
reg ADD "\\%cmp%\HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" /v UpdateTopLevelDomainZones /t REG_DWORD /d 00000001 /f
if "%SD%" EQU "N" goto :EOF
if /i "%COMPUTERNAME%" EQU "%cmp%" goto :EOF
shutdown -r -f -m \\%cmp% -t 61 -c "Close all applications. Your computer will restart is 60 seconds"

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.