Tag Archives: DNS

Setting Dns entries on network properties from remote.

Tricky one recently where the server wasnt responding to RDP… the DNS entries on this webserver were incorrect and it couldnt lookup its connection to an oracle database.

I connected over psexec, and used netsh to dump the current configuration.

  • netsh  interface  ip  dump

this command should give you an output similar to below:

# ———————————-
# Interface IP Configuration
# ———————————-
pushd interface ip

# Interface IP Configuration for “Local Area Connection 5″

set address name=”Local Area Connection 5″ source=static addr=192.168.1.20 mask
=255.255.255.0
set address name=”Local Area Connection 5″ gateway=192.168.1.1 gwmetric=0
set dns name=”Local Area Connection 5″ source=static addr=192.168.1.115 register=PRIMARY
add dns name=”Local Area Connection 5″ addr=192.168.1.116 index=2
popd
# End of interface IP configuration

looking at the above,

To set the primary server the command would be:

netsh interface ip set dns name=”Local Area Connection 5″ source=static addr=192.168.1.115 register=PRIMARY

and to set the secondary:

netsh interface ip add dns name=”Local Area Connection 5″ addr=192.168.1.116 index=2

you can set more than two if you like using the above command and incrementing the “index” by one.