Remove-AzureDnsRecordSet
Remove-AzureDnsRecordSet
Deletes a record set.
Syntax
Parameter Set: Fields
Remove-AzureDnsRecordSet -Name <String> -RecordType <RecordType> {A | AAAA | CNAME | MX | NS | PTR | SOA | SRV | TXT} -ResourceGroupName <String> -ZoneName <String> [-Force] [-PassThru] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]
Parameter Set: Mixed
Remove-AzureDnsRecordSet -Name <String> -RecordType <RecordType> {A | AAAA | CNAME | MX | NS | PTR | SOA | SRV | TXT} -Zone <DnsZone> [-Force] [-PassThru] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]
Parameter Set: Object
Remove-AzureDnsRecordSet -RecordSet <DnsRecordSet> [-Force] [-Overwrite] [-PassThru] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]
Detailed Description
The Remove-AzureDnsRecordSet cmdlet deletes the specified record set from the specified zone. You cannot delete SOA and NS records that are automatically created.
You can pass a RecordSet object to this cmdlet by using the pipeline operator or as a parameter. To identify a record set by name and type without using a RecordSet object, you must pass the zone as a DnsZone object to this cmdlet by using the pipeline operator or as a parameter, or alternatively you can specify the ZoneName parameter.
Parameters
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of the RecordSet to remove.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Overwrite
Indicates that this cmdlet ignores the Etag when deleting the record set, and that the record set is deleted even if it has changed since the last Get.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PassThru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Profile<Microsoft.Azure.Common.Authentication.Models.AzureProfile>
Specifies an Azure profile.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-RecordSet<DnsRecordSet>
Specifies the RecordSet to remove.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByValue) |
Accept Wildcard Characters? |
false |
-RecordType<RecordType>
Specifies the type of DNS record. Valid values are:
-- A
-- AAAA
-- CNAME
-- MS
-- NS
-- PTR
-- SRV
-- TXT
You cannot remove record sets for SOA records.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-ResourceGroupName<String>
Specifies the resource group that contains the DNS zone that contains the RecordSet to delete.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-Zone<DnsZone>
Specifies the DNS zone that contains the RecordSet to delete.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByValue) |
Accept Wildcard Characters? |
false |
-ZoneName<String>
Specifies the name of the zone that contains the RecordSet to delete.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
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.
Microsoft.Azure.Commands.Dns.DnsRecordSet
You can pipe a RecordSet object to this cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None
This cmdlet does not generate any output.
Examples
Example 1: Remove a record set
The first command gets the specified record set, and then stores it in the $RecordSet variable.
The second command removes the record set in $RecordSet.
PS C:\> $RecordSet = Get-AzureDnsRecordSet -Name "www" -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
PS C:\> Remove-AzureDnsRecordSet -RecordSet $RecordSet