Set-HcsDnsClientServerAddress
Set-HcsDnsClientServerAddress
Sets the server addresses for a Domain Name System (DNS) client device.
Syntax
Parameter Set: Default
Set-HcsDnsClientServerAddress [-PrimaryIPv4 <IPAddress> ] [-PrimaryIPv6 <IPAddress> ] [-SecondaryIPv4 <IPAddress[]> ] [-SecondaryIPv6 <IPAddress[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Set-HcsDnsClientServerAddress cmdlet sets the server addresses for a DNS client device.
Parameters
-PrimaryIPv4<IPAddress>
Specifies the primary IPv4 server address for a DNS client.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PrimaryIPv6<IPAddress>
Specifies the primary IPv6 server address for a DNS client.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SecondaryIPv4<IPAddress[]>
Specifies an array of secondary IPv4 server addresses for a DNS client. If the client cannot resolve the primary server, it uses a secondary server address.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SecondaryIPv6<IPAddress[]>
Specifes an array of secondary IPv6 server addresses for a DNS client. If the client cannot resolve the primary server, it uses a secondary server address.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HCS.Management.Powershell.Cmdlets.DnsInfo
The DnsInfo object has the following properties:
-- IPAddress PrimaryIPv4
-- IPAddress PrimaryIPv6
-- IPAddress[] SecondaryIPv4
-- IPAddress[] SecondaryIPv6
Examples
Example 1: Set the primary DNS address
This command specifies the PrimaryIPv4 parameter to set the primary IPv4 DNS server address for a client.
PS C:\> Set-HcsDnsClientServerAddress -PrimaryIPv4
Example 2: Set the address for two secondary DNS servers
This command specifies the SecondaryIPv4 parameter to set two secondary IPv4 DNS server addresses for a client.
PS C:\> Set-HcsDnsClientServerAddress -SecondaryIPv4