You want to update the DNS servers used by the DNS resolver on a Windows computer using the command-line, either directly on the PC or via a remote command-line.
You need change the DNS servers a machine is using and only have access to the command line. For example, a workstation has it’s DNS server statically assigned and it is incorrect. You may not be able to login as an admin on the console since the machine probably cannot reach a domain controller. You can use either PSTools or GFI’s Remote Background.
- Connect to the machine’s console
- Run netsh
- At the prompt, switch to ipv4 context:
netsh> interface ipv4
- Add the new DNS server
netsh interface ipv4> add dnsservers “Local Area Connection” ip-address