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

Create a new A record

This command adds a host address (A) record to your DNS zone.

Add-DnsServerResourceRecordA -Name "hostname" -ZoneName "powershellengineering.com" -IPv4Address "127.0.0.1" 

 

Useful parameters:

-CreatePtr

            Creates a corresponding PTR record.

 

-AllowUpdateAny

            Gives any authenticated user rights to update the record.

  

Reference:

https://docs.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverresourcerecorda?view=win10-ps