Scripting four static DNS servers

J

Juha

Hi

Our problems regarding IPSec VPN has lead us to making a temp "login script"
which shoud assing to networkadapter four fixed DNS servers. Another script
should set the setting back to automatic.

I have tested this script and it succesfully sets one DNS server. The
problem is hot to set second, third and fourth DNS-servers by script.

SetDNS_Manually.bat
netsh interface ip set dns "LAN" static 200.200.200.10 primary
"C:\Documents and Settings\harri ahola.TUKIKOMPPANIA\Desktop\SkriptLine1.log"


Thanks,

Juha
 
C

CTOS

Examples:

netsh interface add dns name="Local Area Connection" addr=192.168.1.1
netsh interface add dns name="Local Area Connection" addr=192.168.1.2
netsh interface add dns name="Local Area Connection" addr=192.168.1.3
 
J

Juha

Thanks CTOS

Sorry for the delay. I receive notifications unfortunately to a Yahoo
account and for some reason the link in there doesn't work.

I also asked our trainee to solve this and he eneded up into this (which
seems to work too):

netsh interface ip add dns "LAN" 192.168.1.1
netsh interface ip add dns "LAN" 193.210.19.19
etc.

And to setting DNS back to dynamic goes like this:
netsh interface ip set dns "LAN" DHCP

I tested to set static IPs to all adapters but it looked that only the last
adapter had static DNS server after the script (in above syntax).

Currently I'm not sure if I can use this since many laptops needening this
are offsore and hard to set up. This is actually the last trick to solve a
VPN problem.

Thank you again,

Juha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top