JSI Tip 8216. How can I change the WINS and DNS addresses the RRAS assigns in Windows 2000 and Windows Server 2003?

Jerold Schulman

July 5, 2004

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

When a client connects via dial-up or VPN, RRAS assigns WINS and DNS addresses that are the same as those configured on the network adapter of the RRAS sever.

NOTE: Windows 2000 and Windows XP clients can receive DNS and WINS settings from the DHCPInform process if the RRAS server is configured as a DHCP relay agent. See How to use DHCP to provide Routing and Remote Access clients with additional DHCP options.

I have scripted RRASWDO.bat to set the WINS and/or DNS server IP addresses that RRAS assigns.

The syntax for using RRASWDO.bat is:

RRASWDO RRASServer [/WINS:xxx.xxx.xxx.xxx[:xxx.xxx.xxx.xxx]] [/DNS:xxx.xxx.xxx.xxx[:xxx.xxx.xxx.xxx]]

Where:

RRASServer                              is the NetBIOS computer name of the RRAS server./WINS:xxx.xxx.xxx.xxx[:xxx.xxx.xxx.xxx] is the IP address of the WINS server, and optionally, the backup WINS server./DNS:xxx.xxx.xxx.xxx[:xxx.xxx.xxx.xxx]  is the IP address of the DNS server, and optionally, multiple additional DNS servers.

NOTE: RRASWDO.bat use REG.EXE, either built-in, or from the Windows 2000 Support Tools on the CD-ROM.

RRASWDO.bat contains:

@echo offsetlocalIf {%2}
{} goto errif not {%4}
{} goto errset RRAS=%1set RRAS=%RRAS:=%set key=\%RRAS%HKLMSystemCurrentControlSetServicesRemoteAccessParametersIP:loopshiftif {%1}=={} goto :finishset param=%1if /i "%param:~0,6%" EQU "/WINS:" goto winsif /i "%param:~0,5%" EQU "/DNS:" goto dns:err@echo Syntax: RRASWDO RRASServer[/WINS:xxx.xxx.xxx.xxx[:xxx.xxx.xxx.xxx]] [/DNS:xxx.xxx.xxx.xxx[:xxx.xxx.xxx.xxx]]endlocalexit /b 1:winsset param=%param:~6%For /f "Tokens=1* Delims=:" %%i in ('@echo %param%') do ( set WINS1=%%i set WINS2=%%j)set work=%WINS2%if "%WINS2%" NEQ "" set work=%WINS2::=%if "%work%" NEQ "%WINS2%" goto errset VName=WINSNameServerset type=REG_SZset data=%WINS1%call :regaddif "%WINS2%" EQU "" goto loopset VName=WINSNameServerBackupset data=%WINS2%call :regaddgoto loop:dnsset param=%param:~5%set param=%param::=%set VName=DNSNameServersset type=REG_MULTI_SZset data=%param%call :regaddgoto loop:regaddREG ADD %key% /v %VName% /t %type% /d %data% /fgoto :EOF:finishendlocalexit /b 0



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