Get-AzureDnsRecordSet
Get-AzureDnsRecordSet
Gets a DNS record set.
Syntax
Parameter Set: Fields
Get-AzureDnsRecordSet -ResourceGroupName <String> -ZoneName <String> [-EndsWith <System.String> ] [-Name <String> ] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-RecordType <String> ] [ <CommonParameters>]
Parameter Set: Object
Get-AzureDnsRecordSet -Zone <DnsZone> [-EndsWith <System.String> ] [-Name <String> ] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-RecordType <String> ] [ <CommonParameters>]
Detailed Description
The Get-AzureDnsRecordSet cmdlet gets the Domain Name System (DNS) record set with the specified name and type, in the specified zone. If you do not specify the Name parameter, this cmdlet returns all record sets of the specified type in the zone.
If you do not specify the RecordType parameter, this cmdlet returns record sets of all types.
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.
Parameters
-EndsWith<System.String>
Specifies a suffix to use as a filter when you get multiple record sets.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of the RecordSet to get. If you do not specify the Name parameter, all record sets of the specified type are returned.
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<String>
Specifies the type of DNS record to get. Valid values are:
-- A
-- AAAA
-- CNAME
-- MS
-- NS
-- PTR
-- SOA
-- SRV
-- TXT
If you do not specify the RecordType parameter, this cmdlet returns record sets of all types.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-ResourceGroupName<String>
Specifies the resource group that contains the DNS zone.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-Zone<DnsZone>
Specifies the DNS zone that contains the record set to get.
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 DNS zone that contains the record set to get.
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.DnsZone
You can pipe a DnsZone object to this cmdlet. The DnsZone object represents the zone in which to look for the RecordSet object.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.Azure.Commands.Dns.DnsRecordSet
This cmdlet returns one or more objects that represents the record sets that are found. There will be at most one RecordSet returned if the Name and RecordType are specified, otherwise multiple RecordSet objects are returned as an array.
Examples
Example 1: Get record sets with a specified name and type
This command gets the record set of record type A named www in the specified resource group and zone, and then stores it in the $RecordSet variable. Because the RecordType parameter is specified, only one RecordSet object is returned.
PS C:\> $RecordSet = Get-AzureDnsRecordSet -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" -Name "www" -RecordType A
Example 2: Get record sets of a specified type
This command gets all of record sets of record type A in the resource group named MyResourceGroup in the zone named myzone.com, and then stores them in the $RecordSet variable.
PS C:\> $RecordSet = Get-AzureDnsRecordSet -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com" -RecordType A
Example 3: Get record sets with a specified name
This command gets all of the record sets named www in the resource group named MyResourceGroup in the zone named myzone.com, and then stores them in the $RecordSet variable.
PS C:\> $RecordSet = Get-AzureDnsRecordSet -Name "www" -ResourceGroupName "MyResourceGroup" -ZoneName "myzone.com"