New-AzureDnsRecordSet

New-AzureDnsRecordSet

Creates a DNS record set.

Syntax

Parameter Set: Fields
New-AzureDnsRecordSet -Name <String> -RecordType <RecordType> {A | AAAA | CNAME | MX | NS | PTR | SOA | SRV | TXT} -ResourceGroupName <String> -Ttl <UInt32> -ZoneName <String> [-Force] [-Overwrite] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-Tag <Hashtable[]> ] [ <CommonParameters>]

Parameter Set: Object
New-AzureDnsRecordSet -Name <String> -RecordType <RecordType> {A | AAAA | CNAME | MX | NS | PTR | SOA | SRV | TXT} -Ttl <UInt32> -Zone <DnsZone> [-Force] [-Overwrite] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-Tag <Hashtable[]> ] [ <CommonParameters>]

Detailed Description

The New-AzureDnsRecordSet cmdlet creates a new Domain Name System (DNS) record set with the specified name and type in the specified zone. A RecordSet is a set of DNS records with the same name and type. Note that the name is relative to the zone and not the fully qualified name.

You can use the pipeline operator to pass a DnsZone object to this cmdlet, or you can pass a DnsZone object as the Zone parameter, or alternatively you can specify the zone by name.

If a matching RecordSet already exists, you must specify the Overwrite parameter, otherwise the cmdlet will not create a new RecordSet.

Parameters

-Force

Forces the command to run without asking for user confirmation. You can use the Force parameter with the Overwrite parameter to overwrite an existing RecordSet.

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 create.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Overwrite

Indicates that this cmdlet overwrites the specified RecordSet if it exists. You will be prompted to confirm the operation unless you specify the Force parameter.

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

-RecordType<RecordType>

Specifies the type of DNS record to create. Valid values are:

-- A
-- AAAA
-- CNAME
-- MS
-- NS
-- PTR
-- SRV
-- TXT

SOA records are created automatically when the zone is created and cannot be created manually.

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 zone.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Tag<Hashtable[]>

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

Aliases

Tags

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Ttl<UInt32>

Specifies the Time to Live (TTL).

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Zone<DnsZone>

Specifies the DnsZone in which to create the RecordSet.

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 in which to create the RecordSet.

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 (http://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.DnsZone

    You can pipe a DnsZone object to this cmdlet.

Outputs

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

  • Microsoft.Azure.Commands.Dns.DnsRecordSet

    This cmdlet returns a RecordSet object.

Examples

Example 1: Create a RecordSet

This command creates a new RecordSet named www as type A in the zone named myzone.com with a TTL of 3600 seconds.

PS C:\> $RecordSet = New-AzureDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com" 

Get-AzureDnsRecordSet

Remove-AzureDnsRecordSet

Set-AzureDnsRecordSet

Using tags to organize your Azure resources