JSI Tip 7799. How do I prevent the DNS Server service from registering extraneous interfaces, including those created by Routing and Remote Access?

Jerold Schulman

March 2, 2004

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

The DNS Server service registers HOST records for all interfaces on the DNS Server computer, including interfaces created by Routing and Remote Access.

I have scripted PublishAddresses.bat to allow you to specify the interfaces you wish registered.

The syntax for using PublishAddresses.bat is:

PublishAddresses Ipaddress1 [Ipaddress2 ... Ipaddressn]

where only HOST records for each IP address listed will be registered.

NOTE: You may have to manually delete any previously registered IP Address using the DNS Manager, after running the script.

PublishAddresses.bat contains:

@echo offsetlocalif {%1}
{} goto syntax@echo REGEDIT4>"%TEMP%PublishAddresses.reg"@echo.>>"%TEMP%PublishAddresses.reg"@echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesDNSParameters]>>"%TEMP%PublishAddresses.reg"set PublishAddresses="PublishAddresses"=":loopset PublishAddresses=%PublishAddresses%%1#shiftif {%1}
{} goto finishgoto loop:syntax@echo Syntax: PublishAddresses Ipaddress1 [Ipaddress2 ... Ipaddressn]exit /b 1:finishset PublishAddresses=%PublishAddresses%"set PublishAddresses=%PublishAddresses:#"="%set PublishAddresses=%PublishAddresses:#= %@echo %PublishAddresses%>>"%TEMP%PublishAddresses.reg"@echo.>>"%TEMP%PublishAddresses.reg"@echo.>>"%TEMP%PublishAddresses.reg"regedit.exe /s "%TEMP%PublishAddresses.reg"del /q "%TEMP%PublishAddresses.reg"net stop DNSnet start DNSendlocalexit /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