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

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 off
setlocal
If \{%2\}

\{\} goto err if not \{%4\}

\{\} goto err set RRAS=%1 set RRAS=%RRAS:\=% set key=\\%RRAS%\HKLM\System\CurrentControlSet\Services\RemoteAccess\Parameters\IP :loop shift if \{%1\}==\{\} goto :finish set param=%1 if /i "%param:~0,6%" EQU "/WINS:" goto wins if /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\]\] endlocal exit /b 1 :wins set 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 err set VName=WINSNameServer set type=REG_SZ set data=%WINS1% call :regadd if "%WINS2%" EQU "" goto loop set VName=WINSNameServerBackup set data=%WINS2% call :regadd goto loop :dns set param=%param:~5% set param=%param::=\0% set VName=DNSNameServers set type=REG_MULTI_SZ set data=%param% call :regadd goto loop :regadd REG ADD %key% /v %VName% /t %type% /d %data% /f goto :EOF :finish endlocal exit /b 0



TAGS: Windows 8
Hide comments

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.
Publish