Remove-AzureDnsRecordConfig

Remove-AzureDnsRecordConfig

Removes a DNS record from a record set.

Syntax

Parameter Set: A
Remove-AzureDnsRecordConfig -Ipv4Address <String> -RecordSet <DnsRecordSet> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Parameter Set: AAAA
Remove-AzureDnsRecordConfig -Ipv6Address <String> -RecordSet <DnsRecordSet> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Parameter Set: CNAME
Remove-AzureDnsRecordConfig -Cname <String> -RecordSet <DnsRecordSet> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Parameter Set: MX
Remove-AzureDnsRecordConfig -Exchange <String> -Preference <UInt16> -RecordSet <DnsRecordSet> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Parameter Set: NS
Remove-AzureDnsRecordConfig -Nsdname <String> -RecordSet <DnsRecordSet> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Parameter Set: PTR
Remove-AzureDnsRecordConfig -Ptrdname <String> -RecordSet <DnsRecordSet> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Parameter Set: SRV
Remove-AzureDnsRecordConfig -Port <UInt16> -Priority <UInt16> -RecordSet <DnsRecordSet> -Target <String> -Weight <UInt16> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Parameter Set: TXT
Remove-AzureDnsRecordConfig -RecordSet <DnsRecordSet> -Value <String> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Detailed Description

The Remove-AzureDnsRecordConfig cmdlet removes a Domain Name System (DNS) record from a record set. The RecordSet object is an offline object, and changes to it do not change the DNS responses until after you run the Set-AzureDnsRecordSet cmdlet to persist the change to the Microsoft Azure DNS service.

To remove a record, all the fields for that record type must match exactly. You cannot add or remove SOA records.

You can pass the RecordSet object to this cmdlet as a parameter or by using the pipeline operator.

Parameters

-Cname<String>

Specifies the domain name for a CNAME record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Exchange<String>

Specifies the mail exchange server name for an MX record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Ipv4Address<String>

Specifies an IPv4 address for an A record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Ipv6Address<String>

Specifies an IPv6 address for an AAAA record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Nsdname<String>

Specifies the name server for an NS record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Port<UInt16>

Specifies the port for an SRV record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Preference<UInt16>

Specifies the preference for an MX record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Priority<UInt16>

Specifies the priority for an SRV record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Profile<Microsoft.Azure.Common.Authentication.Models.AzureProfile>

Specifies the domain name for a CNAME record.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Ptrdname<String>

Specifies the DNAME of a PTR record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-RecordSet<DnsRecordSet>

Specifies the RecordSet that contains the record to remove.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByValue)

Accept Wildcard Characters?

false

-Target<String>

Specifies the target for an SRV record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Value<String>

Specifies the value for a TXT record.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Weight<UInt16>

Specifies the weight for an SRV record.

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 DnsRecordSet object to this cmdlet. This is an offline representation of the record set and updates to it do not change DNS responses until after you run Set-AzureDnsRecordSet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Azure.Commands.Dns.DnsRecordSet

    This cmdlet returns the modified RecordSet object.

Examples

Example 1: Remove A records

This command removes the A records with the specified IP address from the record set stored in $RecordSet.

PS C:\> $RecordSet = Remove-AzureDnsRecordConfig -RecordSet $RecordSet -Ipv4Address "172.16.0.0"  

Example 2: Remove specified SRV records

This command removes SRV records from the $RecordSet variable where Port=8080, Priority=0, Weight=5, and Target=target.example.com.

PS C:\> $RecordSet = Remove-AzureDnsRecordConfig -Port 8080 -Priority 0 -RecordSet $RecordSet -Target "target.example.com" -Weight 5

Add-AzureDnsRecordConfig

Get-AzureDnsRecordSet

Set-AzureDnsRecordSet