Monday, December 13, 2021

Updating DNS servers via command line

Problem: Updating DNS to a static address on a subset of users.
No VLANs
No network segmentation
Basically, can't be done via DHCP due to hardware and previous configuration limitations.

Using CMD, the DNS servers can be changed from DHCP to Static, if you have a remote tool (LogMeIn, Splashtop, etc) that can connect to the computers and run CMD line instructions, this could help. WMIC node: or powershell may allow you to run the same if your environment is compatible.

Find the name of the interface:

netsh interface ipv4 show config

Also, ipconfig/all will work

Update DNS to static:

netsh interface ipv4 set dns name="(InterfaceName)" static 1.1.1.1

Add second DNS server:

netsh interface ipv4 add dnsserver "(InterfaceName)" address=8.8.8.8

No comments:

Post a Comment

Samsung refrigerator not making ice

How I got my stupid fridge to work again. Normally, I press/hold the blue button till it chimes. Well that didn’t work this time. Darn. I re...