Associate DNS with TCP/IP

This command associates DNS information with TCP/IP addresses on to an interface.

Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("127.0.0.1,"127.0.0.2")

 

Useful parameters:

-InterfaceAlias

            Specifies the name of the interface.

 

-ServerAdresses

            Specifies a list of DNS server IP addresses to use.

  

Reference:

https://docs.microsoft.com/en-us/powershell/module/dnsclient/Set-DnsClientServerAddress?view=win10-ps