< Back
New-AzureRmDnsRecordConfig
Post
NAME New-AzureRmDnsRecordConfig
SYNOPSIS
Creates a new DNS record local object.
SYNTAX
New-AzureRmDnsRecordConfig -CaaFlags <Byte> -CaaTag <String> -CaaValue <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
New-AzureRmDnsRecordConfig -Cname <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Exchange <String> -Preference <UInt16> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Ipv4Address <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Ipv6Address <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Nsdname <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Port <UInt16> -Priority <UInt16> -Target <String> -Weight <UInt16>
[<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Ptrdname <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Value <String> [<CommonParameters>]
DESCRIPTION
The New-AzureRmDnsRecordConfig cmdlet creates a local DnsRecord object. An array of these objects is passed to the New-AzureRmDnsRecordSet cmdlet
using the DnsRecords parameter to specify the records to create in the record set.
PARAMETERS
-CaaFlags <Byte>
The flags for the CAA record to add. Must be a number between 0 and 255.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-CaaTag <String>
The tag field of the CAA record to add.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-CaaValue <String>
The value field for the CAA record to add.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Cname <String>
Specifies the domain name for a canonical name (CNAME) record.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Exchange <String>
Specifies the mail exchange server name for a mail exchange (MX) record.
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.
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Nsdname <String>
Specifies the name server name for a name server (NS) record.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Port <UInt16>
Specifies the port for a service (SRV) record.
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.
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Ptrdname <String>
Specifies the target domain name of a pointer resource (PTR) record.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Target <String>
Specifies the target for an SRV record.
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.
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.
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, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None.
OUTPUTS
Microsoft.Azure.Commands.Dns.DnsRecordBase
NOTES
Example 1: Create a RecordSet of type A
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -IPv4Address 1.2.3.4
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
# When creating a RecordSet containing a single record, the above sequence can also be condensed into a single line:
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords (New-AzureRmDnsRecordConfig -IPv4Address 1.2.3.4)
# To create a record set containing multiple records, use New-AzureRmDnsRecordConfig to add each record to the $Records array,
# then call New-AzureRmDnsRecordSet, as follows:
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -IPv4Address 1.2.3.4
PS C:\\> $Records += New-AzureRmDnsRecordConfig -IPv4Address 5.6.7.8
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This example creates a RecordSet named www in the zone myzone.com. The record set is of type A and has a TTL of 1 hour (3600 seconds). It contains
a single DNS record.
Example 2: Create a RecordSet of type AAAA
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Ipv6Address 2001:db8::1
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType AAAA -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This example creates a RecordSet named www in the zone myzone.com. The record set is of type AAAA and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 3: Create a RecordSet of type CNAME
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Cname www.contoso.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType CNAME -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This example creates a RecordSet named www in the zone myzone.com. The record set is of type CNAME and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 4: Create a RecordSet of type MX
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Exchange "mail.microsoft.com" -Preference 5
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType AAAA -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This command creates a RecordSet named www in the zone myzone.com. The record set is of type MX and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 5: Create a RecordSet of type NS
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Nsdname ns1-01.azure-dns.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "ns1" -RecordType NS -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This command creates a RecordSet named ns1 in the zone myzone.com. The record set is of type NS and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 6: Create a RecordSet of type PTR
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Ptrdname www.contoso.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "4" -RecordType PTR -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName
"3.2.1.in-addr.arpa" -DnsRecords $Records
This command creates a RecordSet named 4 in the zone 3.2.1.in-addr.arpa. The record set is of type PTR and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 7: Create a RecordSet of type SRV
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Priority 0 -Weight 5 -Port 8080 -Target sipservice.contoso.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "_sip._tcp" -RecordType SRV -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName
"myzone.com" -DnsRecords $Records
This command creates a RecordSet named _sip._tcp in the zone myzone.com. The record set is of type SRV and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record, pointing to the IP address 2001.2.3.4.
The service (sip) and the protocol (tcp) are specified as part of the record set name, not as part of the record data.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 8: Create a RecordSet of type TXT
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Value "This is a TXT Record"
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "text" -RecordType TXT -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This command creates a RecordSet named text in the zone myzone.com. The record set is of type TXT and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... cordconfig
Add-AzureRmDnsRecordConfig
New-AzureRmDnsRecordSet
Remove-AzureRmDnsRecordConfig
SYNOPSIS
Creates a new DNS record local object.
SYNTAX
New-AzureRmDnsRecordConfig -CaaFlags <Byte> -CaaTag <String> -CaaValue <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
New-AzureRmDnsRecordConfig -Cname <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Exchange <String> -Preference <UInt16> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Ipv4Address <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Ipv6Address <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Nsdname <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Port <UInt16> -Priority <UInt16> -Target <String> -Weight <UInt16>
[<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Ptrdname <String> [<CommonParameters>]
New-AzureRmDnsRecordConfig [-DefaultProfile <IAzureContextContainer>] -Value <String> [<CommonParameters>]
DESCRIPTION
The New-AzureRmDnsRecordConfig cmdlet creates a local DnsRecord object. An array of these objects is passed to the New-AzureRmDnsRecordSet cmdlet
using the DnsRecords parameter to specify the records to create in the record set.
PARAMETERS
-CaaFlags <Byte>
The flags for the CAA record to add. Must be a number between 0 and 255.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-CaaTag <String>
The tag field of the CAA record to add.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-CaaValue <String>
The value field for the CAA record to add.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Cname <String>
Specifies the domain name for a canonical name (CNAME) record.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Exchange <String>
Specifies the mail exchange server name for a mail exchange (MX) record.
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.
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Nsdname <String>
Specifies the name server name for a name server (NS) record.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Port <UInt16>
Specifies the port for a service (SRV) record.
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.
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Ptrdname <String>
Specifies the target domain name of a pointer resource (PTR) record.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Target <String>
Specifies the target for an SRV record.
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.
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.
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, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None.
OUTPUTS
Microsoft.Azure.Commands.Dns.DnsRecordBase
NOTES
Example 1: Create a RecordSet of type A
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -IPv4Address 1.2.3.4
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
# When creating a RecordSet containing a single record, the above sequence can also be condensed into a single line:
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords (New-AzureRmDnsRecordConfig -IPv4Address 1.2.3.4)
# To create a record set containing multiple records, use New-AzureRmDnsRecordConfig to add each record to the $Records array,
# then call New-AzureRmDnsRecordSet, as follows:
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -IPv4Address 1.2.3.4
PS C:\\> $Records += New-AzureRmDnsRecordConfig -IPv4Address 5.6.7.8
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This example creates a RecordSet named www in the zone myzone.com. The record set is of type A and has a TTL of 1 hour (3600 seconds). It contains
a single DNS record.
Example 2: Create a RecordSet of type AAAA
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Ipv6Address 2001:db8::1
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType AAAA -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This example creates a RecordSet named www in the zone myzone.com. The record set is of type AAAA and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 3: Create a RecordSet of type CNAME
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Cname www.contoso.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType CNAME -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This example creates a RecordSet named www in the zone myzone.com. The record set is of type CNAME and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 4: Create a RecordSet of type MX
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Exchange "mail.microsoft.com" -Preference 5
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "www" -RecordType AAAA -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This command creates a RecordSet named www in the zone myzone.com. The record set is of type MX and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 5: Create a RecordSet of type NS
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Nsdname ns1-01.azure-dns.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "ns1" -RecordType NS -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This command creates a RecordSet named ns1 in the zone myzone.com. The record set is of type NS and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 6: Create a RecordSet of type PTR
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Ptrdname www.contoso.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "4" -RecordType PTR -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName
"3.2.1.in-addr.arpa" -DnsRecords $Records
This command creates a RecordSet named 4 in the zone 3.2.1.in-addr.arpa. The record set is of type PTR and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 7: Create a RecordSet of type SRV
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Priority 0 -Weight 5 -Port 8080 -Target sipservice.contoso.com
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "_sip._tcp" -RecordType SRV -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName
"myzone.com" -DnsRecords $Records
This command creates a RecordSet named _sip._tcp in the zone myzone.com. The record set is of type SRV and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record, pointing to the IP address 2001.2.3.4.
The service (sip) and the protocol (tcp) are specified as part of the record set name, not as part of the record data.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
Example 8: Create a RecordSet of type TXT
PS C:\\> $Records = @()
PS C:\\> $Records += New-AzureRmDnsRecordConfig -Value "This is a TXT Record"
PS C:\\> $RecordSet = New-AzureRmDnsRecordSet -Name "text" -RecordType TXT -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com"
-DnsRecords $Records
This command creates a RecordSet named text in the zone myzone.com. The record set is of type TXT and has a TTL of 1 hour (3600 seconds). It
contains a single DNS record.
To create a RecordSet using only one line of pn_PowerShell_short, or to create a record set with multiple records, see Example 1.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... cordconfig
Add-AzureRmDnsRecordConfig
New-AzureRmDnsRecordSet
Remove-AzureRmDnsRecordConfig