external help file | Module Name | online version | schema |
---|---|---|---|
Microsoft.Azure.PowerShell.Cmdlets.PrivateDns.dll-Help.xml |
Az.PrivateDns |
2.0.0 |
Removes a Private DNS record from a local record set object.
Remove-AzPrivateDnsRecordConfig -RecordSet <PSPrivateDnsRecordSet> -Ipv4Address <String>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Remove-AzPrivateDnsRecordConfig -RecordSet <PSPrivateDnsRecordSet> -Ipv6Address <String>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Remove-AzPrivateDnsRecordConfig -RecordSet <PSPrivateDnsRecordSet> -Exchange <String> -Preference <UInt16>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Remove-AzPrivateDnsRecordConfig -RecordSet <PSPrivateDnsRecordSet> -Ptrdname <String>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Remove-AzPrivateDnsRecordConfig -RecordSet <PSPrivateDnsRecordSet> -Value <String>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Remove-AzPrivateDnsRecordConfig -RecordSet <PSPrivateDnsRecordSet> -Priority <UInt16> -Target <String>
-Port <UInt16> -Weight <UInt16> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Remove-AzPrivateDnsRecordConfig -RecordSet <PSPrivateDnsRecordSet> -Cname <String>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
The Remove-AzPrivateDnsRecordConfig cmdlet removes a Private Domain Name System (DNS) record from a record set. The RecordSet object is an offline object, and changes to it do not change the Private DNS responses until after you run the Set-AzPrivateDnsRecordSet cmdlet to persist the change to the Microsoft Azure Private DNS service. To remove a record, all the fields for that record type must match exactly. You cannot add or remove SOA records. SOA records are automatically created when a Private DNS zone is created and automatically deleted when the Private DNS zone is deleted. You can pass the RecordSet object to this cmdlet as a parameter or by using the pipeline operator.
$RecordSet = Get-AzPrivateDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
Remove-AzPrivateDnsRecordConfig -RecordSet $RecordSet -Ipv4Address 1.2.3.4
Set-AzPrivateDnsRecordSet -RecordSet $RecordSet
# The above sequence can also be piped:
Get-AzPrivateDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" | Remove-AzPrivateDnsRecordConfig -Ipv4Address 1.2.3.4 | Set-AzPrivateDnsRecordSet
Id : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Micros
oft.Network/privateDnsZones/myzone.com/A/www
Name : www
ZoneName : myzone.com
ResourceGroupName : MyResourceGroup
Ttl : 3600
Etag : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RecordType : A
Records : {}
Metadata :
IsAutoRegistered :
This example removes an A record from an existing record set. If this is the only record in the record set, the result will be an empty record set. To remove a record set entirely, see Remove-AzPrivateDnsRecordSet.
$RecordSet = Get-AzPrivateDnsRecordSet -Name "www" -RecordType AAAA -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
Remove-AzPrivateDnsRecordConfig -RecordSet $RecordSet -Ipv6Address 2001:DB80:4009:1803::1005
Set-AzPrivateDnsRecordSet -RecordSet $RecordSet
# The above sequence can also be piped:
Get-AzPrivateDnsRecordSet -Name "www" -RecordType AAAA -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" | Remove-AzPrivateDnsRecordConfig -Ipv6Address 2001:DB80:4009:1803::1005 | Set-AzPrivateDnsRecordSet
Id : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Micros
oft.Network/privateDnsZones/myzone.com/AAAA/www
Name : www
ZoneName : myzone.com
ResourceGroupName : MyResourceGroup
Ttl : 3600
Etag : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RecordType : AAAA
Records : {}
Metadata :
IsAutoRegistered :
This example removes an AAAA record from an existing record set. If this is the only record in the record set, the result will be an empty record set. To remove a record set entirely, see Remove-AzPrivateDnsRecordSet.
$RecordSet = Get-AzPrivateDnsRecordSet -Name "www" -RecordType CNAME -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
Remove-AzPrivateDnsRecordConfig -RecordSet $RecordSet -Cname contoso.com
Set-AzPrivateDnsRecordSet -RecordSet $RecordSet
# The above sequence can also be piped:
Get-AzPrivateDnsRecordSet -Name "www" -RecordType CNAME -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" | Remove-AzPrivateDnsRecordConfig -Cname contoso.com | Set-AzPrivateDnsRecordSet
Id : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Micros
oft.Network/privateDnsZones/myzone.com/CNAME/www
Name : www
ZoneName : myzone.com
ResourceGroupName : MyResourceGroup
Ttl : 3600
Etag : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RecordType : CNAME
Records : {}
Metadata :
IsAutoRegistered :
This example removes a CNAME record from an existing record set. Because a CNAME record set can contain at most one record, the result is an empty record set.
$RecordSet = Get-AzPrivateDnsRecordSet -Name "@" -RecordType MX -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
Remove-AzPrivateDnsRecordConfig -Exchange mail.microsoft.com -Preference 5 -RecordSet $RecordSet
Set-AzPrivateDnsRecordSet -RecordSet $RecordSet
# The above sequence can also be piped:
Get-AzPrivateDnsRecordSet -Name "@" -RecordType MX -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" | Remove-AzPrivateDnsRecordConfig -Exchange mail.microsoft.com -Preference 5 | Set-AzPrivateDnsRecordSet
Id : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Micros
oft.Network/privateDnsZones/myzone.com/MX/www
Name : www
ZoneName : myzone.com
ResourceGroupName : MyResourceGroup
Ttl : 3600
Etag : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RecordType : MX
Records : {}
Metadata :
IsAutoRegistered :
This example removes an MX record from an existing record set. The record name "@" indicates a record set at the zone apex. If this is the only record in the record set, the result is an empty record set. To remove a record set entirely, see Remove-AzPrivateDnsRecordSet.
$RecordSet = Get-AzPrivateDnsRecordSet -Name "4" -RecordType PTR -ResourceGroupName "MyResourceGroup" -ZoneName 3.2.1.in-addr.arpa
Remove-AzPrivateDnsRecordConfig -Ptrdname www.contoso.com -RecordSet $RecordSet
Set-AzPrivateDnsRecordSet -RecordSet $RecordSet
# The above sequence can also be piped:
Get-AzPrivateDnsRecordSet -Name "4" -RecordType PTR -ResourceGroupName "MyResourceGroup" -ZoneName "3.2.1.in-addr.arpa" | Remove-AzPrivateDnsRecordConfig -Ptrdname www.contoso.com | Set-AzPrivateDnsRecordSet
Id : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Micros
oft.Network/privateDnsZones/3.2.1.in-addr.arpa/PTR/4
Name : 4
ZoneName : 3.2.1.in-addr.arpa
ResourceGroupName : MyResourceGroup
Ttl : 3600
Etag : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RecordType : PTR
Records : {}
Metadata :
IsAutoRegistered :
This example removes a PTR record from an existing record set. If this is the only record in the record set, the result is an empty record set. To remove a record set entirely, see Remove-AzPrivateDnsRecordSet.
$RecordSet = Get-AzPrivateDnsRecordSet -Name "_sip._tcp" -RecordType SRV -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
Remove-AzPrivateDnsRecordConfig -RecordSet $RecordSet -Priority 0 -Weight 5 -Port 8080 -Target target.example.com
Set-AzPrivateDnsRecordSet -RecordSet $RecordSet
# The above sequence can also be piped:
Get-AzPrivateDnsRecordSet -Name "_sip._tcp" -RecordType SRV -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" | Remove-AzPrivateDnsRecordConfig -Priority 0 -Weight 5 -Port 8080 -Target target.example.com | Set-AzPrivateDnsRecordSet
Id : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Micros
oft.Network/privateDnsZones/myzone.com/SRV/_sip._tcp
Name : _sip._tcp
ZoneName : myzone.com
ResourceGroupName : MyResourceGroup
Ttl : 3600
Etag : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RecordType : SRV
Records : {}
Metadata :
IsAutoRegistered :
This example removes an SRV record from an existing record set. If this is the only record in the record set, the result is an empty record set. To remove a record set entirely, see Remove-AzPrivateDnsRecordSet.
$RecordSet = Get-AzPrivateDnsRecordSet -Name "text" -RecordType TXT -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"
Remove-AzPrivateDnsRecordConfig -RecordSet $RecordSet -Value "This is a TXT Record"
Set-AzPrivateDnsRecordSet -RecordSet $RecordSet
# The above sequence can also be piped:
Get-AzPrivateDnsRecordSet -Name "text" -RecordType TXT -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" | Remove-AzPrivateDnsRecordConfig -Value "This is a TXT Record" | Set-AzPrivateDnsRecordSet
Id : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Micros
oft.Network/privateDnsZones/myzone.com/TXT/text
Name : text
ZoneName : myzone.com
ResourceGroupName : MyResourceGroup
Ttl : 3600
Etag : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RecordType : TXT
Records : {}
Metadata :
IsAutoRegistered :
This example removes a TXT record from an existing record set. If this is the only record in the record set, the result is an empty record set. To remove a record set entirely, see Remove-AzPrivateDnsRecordSet.
The canonical name of the CNAME record to remove. Must not be relative to the name of the zone. Must not have a terminating dot
Type: System.String
Parameter Sets: CNAME
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The credentials, account, tenant, and subscription used for communication with Azure.
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The mail exchange host of the MX record to remove. Must not be relative to the name of the zone. Must not have a terminating dot
Type: System.String
Parameter Sets: MX
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The IPv4 address of the A record to remove.
Type: System.String
Parameter Sets: A
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The IPv6 address of the AAAA record to remove.
Type: System.String
Parameter Sets: AAAA
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The port number of the SRV record to remove.
Type: System.UInt16
Parameter Sets: SRV
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The preference value of the MX record to remove.
Type: System.UInt16
Parameter Sets: MX
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The priority value of the SRV record to remove.
Type: System.UInt16
Parameter Sets: SRV
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The target host of the PTR record to remove. Must not be relative to the name of the zone. Must not have a terminating dot
Type: System.String
Parameter Sets: PTR
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The record set from which to remove the record.
Type: Microsoft.Azure.Commands.PrivateDns.Models.PSPrivateDnsRecordSet
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The target host of the SRV record to remove. Must not be relative to the name of the zone. Must not have a terminating dot
Type: System.String
Parameter Sets: SRV
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The text value of the TXT record to remove.
Type: System.String
Parameter Sets: TXT
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The weight value of the SRV record to remove.
Type: System.UInt16
Parameter Sets: SRV
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).