DNS Assignment

  • Thread starter Thread starter James
  • Start date Start date
J

James

I need to know if there is a way to assign the DNS #'s in
a similar fashion as I use when assigning IP #'s with the
netsh command. It looks like this -- Netsh interface ip
set address "Local Area Connection" static 198.105.110.30
255.255.255.0 198.105.110.254 1
 
I need to know if there is a way to assign the DNS #'s in
a similar fashion as I use when assigning IP #'s with the
netsh command. It looks like this -- Netsh interface ip
set address "Local Area Connection" static 198.105.110.30
255.255.255.0 198.105.110.254 1

Your question is unclear. The DNS "#"s are the same ones you use
on the interface for each machine.

If you mean, you need a command line too, then use DnsCmd.exe for
DNS control.
 
-----Original Message-----

Your question is unclear. The DNS "#"s are the same ones you use
on the interface for each machine.

If you mean, you need a command line too, then use DnsCmd.exe for
DNS control.
Herb
The problem is this. I have a laptop which I use on 2
separate networks. On one network I have to go into
my "Local Area Connection" and set the properties. I use
IP #'s and DNS #'s given to my by my network
administrator. On the other network I connect to, these
settings are obtained automatically. I currently use a
program called Network Device Switch. I works well but my
goal is to eliminate having to click on the program, click
the appropriate configuration, and wait for the change to
be made. I would like to write a logon script for each
network to do this for me. I have been able to find the
command to map and disconnect from my network devices and
I have found the command to change my IP's. What I need
now is a command that will allow me to change my DNS. Any
help would be great. Thanks
 
be made. I would like to write a logon script for each
network to do this for me. I have been able to find the
command to map and disconnect from my network devices and
I have found the command to change my IP's. What I need
now is a command that will allow me to change my DNS. Any
help would be great. Thanks

So what I now understand is that you want to be able to change
your client NIC settings, including specifying the "DNS Server"
to use?

Simplest way (especially since you are familiar with NetSh) is to
first connect to the network and manually configure the correct
settings before doing:

netsh dump >myNic1.txt

Then edit myNic1.txt for the settings you need, and write the script to use
netsh -f myNic1.txt

NetSh.exe dump will dump the instructions you need to reset it later.

You can also do this for various contexts if that works better for you.
 
So what I now understand is that you want to be able to change
your client NIC settings, including specifying the "DNS Server"
to use?

Simplest way (especially since you are familiar with NetSh) is to
first connect to the network and manually configure the correct
settings before doing:

netsh dump >myNic1.txt

Then edit myNic1.txt for the settings you need, and write the script to use
netsh -f myNic1.txt

NetSh.exe dump will dump the instructions you need to reset it later.

You can also do this for various contexts if that works better for you.
Herb

Thank you. I will give this a try and If you like I will
let you know how I do. This network stuff is new to me
and I enjoy learning new thing.

Again, Thank you
 
Thank you. I will give this a try and If you like I will
let you know how I do. This network stuff is new to me
and I enjoy learning new thing.

Yes, please let me and everyone know your solution -- that
is how we can all learn more.

I thought from your first message request that you already
understood NetSh.exe so didn't emphasize how to get that
program to work.
 
Back
Top