Set-HcsDnsClientServerAddress
Set-HcsDnsClientServerAddress
Sets the server addresses for a Domain Name System (DNS) client device.
語法
Parameter Set: Default
Set-HcsDnsClientServerAddress [-PrimaryIPv4 <IPAddress> ] [-PrimaryIPv6 <IPAddress> ] [-SecondaryIPv4 <IPAddress[]> ] [-SecondaryIPv6 <IPAddress[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細描述
The Set-HcsDnsClientServerAddress cmdlet sets the server addresses for a DNS client device.
參數
-PrimaryIPv4<IPAddress>
Specifies the primary IPv4 server address for a DNS client.
別名 |
無 |
必要? |
false |
位置? |
named |
預設值 |
無 |
接受管線輸入? |
false |
接受萬用字元? |
false |
-PrimaryIPv6<IPAddress>
Specifies the primary IPv6 server address for a DNS client.
別名 |
無 |
必要? |
false |
位置? |
named |
預設值 |
無 |
接受管線輸入? |
false |
接受萬用字元? |
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.
別名 |
無 |
必要? |
false |
位置? |
named |
預設值 |
無 |
接受管線輸入? |
false |
接受萬用字元? |
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.
別名 |
無 |
必要? |
false |
位置? |
named |
預設值 |
無 |
接受管線輸入? |
false |
接受萬用字元? |
false |
-Confirm
執行 Cmdlet 之前先提示您確認。
必要? |
false |
位置? |
named |
預設值 |
false |
接受管線輸入? |
false |
接受萬用字元? |
false |
-WhatIf
顯示執行 Cmdlet 後會發生的情況。未執行 Cmdlet。
必要? |
false |
位置? |
named |
預設值 |
false |
接受管線輸入? |
false |
接受萬用字元? |
false |
<CommonParameters>
此 Cmdlet 支援一般參數:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 與 -OutVariable。如需詳細資訊,請參閱 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
輸入
輸入類型是您可以使用管線處理方式傳遞給 Cmdlet 的物件類型。
輸出
輸出類型是 Cmdlet 所發出的物件類型。
Microsoft.HCS.Management.Powershell.Cmdlets.DnsInfo
The DnsInfo object has the following properties:
-- IPAddress PrimaryIPv4
-- IPAddress PrimaryIPv6
-- IPAddress[] SecondaryIPv4
-- IPAddress[] SecondaryIPv6
範例
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