Add-AzureDnsRecordConfig

Add-AzureDnsRecordConfig

Adds a DNS record to a record set.

Syntax

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

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

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

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

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

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

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

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

Detailed Description

The Add-AzureDnsRecordConfig cmdlet adds a Domain Name System (DNS) record to a RecordSet object. 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.

You cannot 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 an Azure profile.

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 object to edit.

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

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: Add an A record to a record set

This command adds an IPv4 address as an A record to the record set stored in the $RecordSet variable.

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

Example 2: Add an AAAA record to a record set

This command adds an IPv6 address as an AAAA record to the record set stored in the $RecordSet variable.

PS C:\> $RecordSet = Add-AzureDnsRecordConfig -RecordSet $RecordSet -Ipv6Address "2001:DB80:4009:1803::1005"

Example 3: Add a CNAME record to a record set

This command adds contoso.com as a CNAME record to the record set stored in the $RecordSet variable.

PS C:\> $RecordSet = Add-AzureDnsRecordConfig -RecordSet $RecordSet -Cname "contoso.com"

Example 4: Add an MX record to a record set

This command adds the specified mail exchange server as an MX record to the record set stored in the $RecordSet variable.

PS C:\> $RecordSet = Add-AzureDnsRecordConfig -Exchange "mail.microsoft.com" -Preference 5 -RecordSet $RecordSet 

Example 5: Add an NS record to a record set

This command adds a name server as an NS record to the record set stored in the $RecordSet variable.

PS C:\> $RecordSet = Add-AzureDnsRecordConfig -Nsdname "contoso.myzone.com" -RecordSet $RecordSet

Example 6: Add an SRV record to a record set

This command adds the specified service locator as an SRV record to the record set stored in the $RecordSet variable.

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

Example 7: Add a TXT record to a record set

This command adds a TXT record to the record set stored in the $RecordSet variable.

PS C:\> $RecordSet = Add-AzureDnsRecordConfig -RecordSet $RecordSet -Value "This is a TXT Record"

Get-AzureDnsRecordSet

Remove-AzureDnsRecordConfig

Set-AzureDnsRecordSet