Set-​Azure​Rm​Dns​Zone

Updates the properties of a DNS zone.

Syntax

Set-AzureRmDnsZone
   -Name <String>
   -ResourceGroupName <String>
   [-Tag <Hashtable>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
Set-AzureRmDnsZone
   [-Overwrite]
   -Zone <DnsZone>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The Set-AzureRmDnsZone cmdlet updates the specified DNS zone in the Azure DNS service. This cmdlet does not update the record sets in the zone.

You can pass a DnsZone object as a parameter or by using the pipeline operator, or alternatively you can specify the ZoneName and ResourceGroupName parameters.

You can use the Confirm parameter and $ConfirmPreference Windows PowerShell variable to control whether the cmdlet prompts you for confirmation.

When passing a DNS zone as an object (using the Zone object or via the pipeline), it is not updated if it has been changed in Azure DNS since the local DnsZone object was retrieved. This provides protection for concurrent changes. You can suppress this behavior with the Overwrite parameter, which updates the zone regardless of concurrent changes.

Examples

Example 1: Update a DNS zone

PS C:\>$Zone = Get-AzureRmDnsZone -Name "myzone.com" -ResourceGroupName "MyResourceGroup"
PS C:\> $Zone.Tags = @(@{"Name"="Dept"; "Value"="Electrical"})
PS C:\> Set-AzureRmDnsZone -Zone $Zone

The first command gets the zone named myzone.com from the specified resource group, and then stores it in the $Zone variable.

The second command updates the tags for $Zone.

The final command commits the change.

Example 2: Update tags for a zone

PS C:\>Set-AzureRmDNSZone -ResourceGroupName "MyResourceGroup" -Name "myzone.com" -Tag @(@{"Name"="Dept"; "Value"="Electrical"})

This command updates the tags for the zone named myzone.com without first explicitly getting the zone.

Required Parameters

-Name

Specifies the name of the DNS zone to update.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group that contains the zone to update. You must also specify the ZoneName parameter.Alternatively, you can specify the zone using a DnsZone object with the Zone parameter or the pipeline.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Zone

Specifies the DNS zone to update.Alternatively, you can specify the zone using the ZoneName and ResourceGroupName parameters.

Type:DnsZone
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Overwrite

When passing a DNS zone as an object (using the Zone object or via the pipeline), it is not updated if it has been changed in Azure DNS since the local DnsZone object was retrieved. This provides protection for concurrent changes. You can suppress this behavior with the Overwrite parameter, which updates the zone regardless of concurrent changes.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Tag

Specifies an array of tags to associate with the DNS zone. Tags are name-value pairs that are represented as hashtables, for instance, @(@{"Name"="dept"; "Value"="shopping"}, @{"Name"="env"; "Value"="production"})

Type:Hashtable
Aliases:Tags
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.Dns.DnsZone

You can pipe a DnsZone object to this cmdlet.

Outputs

Microsoft.Azure.Commands.Dns.DnsZone

This cmdlet returns a DnsZone object that represents the updated DNS zone with a new Etag.

Notes

You can use the Confirm parameter to control whether this cmdlet prompts you for confirmation. By default, the cmdlet prompts you for confirmation if the $ConfirmPreference Windows PowerShell variable has a value of Medium or lower.

If you specify Confirm or Confirm:$True, this cmdlet prompts you for confirmation before it runs. If you specify Confirm:$False, the cmdlet does not prompt you for confirmation.