Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

group policy to set dns

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
US
Looking for a group policy to set primary and secondary dns settings to push down to end users' machines...currently have setup a login script batch file with the following but it is not updating...any help would be appreciated.

@echo off
set dnsserver=primary ip
set dnsserver2=secondary ip
for /f "tokens=1,2,3*" %%i in ('netsh interface show interface') do (
if %%i EQU Enabled (
rem echo change "%%l" : %dnsserver%
netsh interface ipv4 set dnsserver name="%%l" static %dnsserver% both
netsh interface ipv4 add dnsserver name="%%l" %dnsserver2% index=2
)
)
 
Do you not have a DHCP server set to push out those IPs? Are you running in a totally static environment?

Learning - A never ending quest for knowledge usually attained by being thrown in a situation and told to fix it NOW.
 
yes, using static...we got it figured out....using the above did work just didn't wait long enough for the policy to apply. This can be closed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top