Menu
Amazon Route 53
API Reference

ListResourceRecordSets

Lists the resource record sets in a specified hosted zone.

ListResourceRecordSets returns up to 100 resource record sets at a time in ASCII order, beginning at a position specified by the name and type elements. The action sorts results first by DNS name with the labels reversed, for example:

com.example.www.

Note the trailing dot, which can change the sort order in some circumstances.

When multiple records have the same DNS name, the action sorts results by the record type.

You can use the name and type elements to adjust the beginning position of the list of resource record sets returned:

If you do not specify Name or Type

The results begin with the first resource record set that the hosted zone contains.

If you specify Name but not Type

The results begin with the first resource record set in the list whose name is greater than or equal to Name.

If you specify Type but not Name

Amazon Route 53 returns the InvalidInput error.

If you specify both Name and Type

The results begin with the first resource record set in the list whose name is greater than or equal to Name, and whose type is greater than or equal to Type.

This action returns the most current version of the records. This includes records that are PENDING, and that are not yet available on all Amazon Route 53 DNS servers.

To ensure that you get an accurate listing of the resource record sets for a hosted zone at a point in time, do not submit a ChangeResourceRecordSets request while you're paging through the results of a ListResourceRecordSets request. If you do, some pages may display results without the latest changes while other pages display results with the latest changes.

Request Syntax

GET /2013-04-01/hostedzone/Id/rrset?identifier=StartRecordIdentifier&maxitems=MaxItems&name=StartRecordName&type=StartRecordType HTTP/1.1

URI Request Parameters

The request requires the following URI parameters.

Id

The ID of the hosted zone that contains the resource record sets that you want to list.

Length Constraints: Maximum length of 32.

identifier

Weighted resource record sets only: If results were truncated for a given DNS name and type, specify the value of NextRecordIdentifier from the previous response to get the next resource record set that has the current DNS name and type.

Length Constraints: Minimum length of 1. Maximum length of 128.

maxitems

(Optional) The maximum number of resource records sets to include in the response body for this request. If the response includes more than maxitems resource record sets, the value of the IsTruncated element in the response is true, and the values of the NextRecordName and NextRecordType elements in the response identify the first resource record set in the next group of maxitems resource record sets.

name

The first name in the lexicographic ordering of resource record sets that you want to list.

Length Constraints: Maximum length of 1024.

type

The type of resource record set to begin the record listing from.

Valid values for basic resource record sets: A | AAAA | CAA | CNAME | MX | NAPTR | NS | PTR | SOA | SPF | SRV | TXT

Values for weighted, latency, geo, and failover resource record sets: A | AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT

Values for alias resource record sets:

  • CloudFront distribution: A or AAAA

  • Elastic Beanstalk environment that has a regionalized subdomain: A

  • ELB load balancer: A | AAAA

  • Amazon S3 bucket: A

  • Another resource record set in this hosted zone: The type of the resource record set that the alias references.

Constraint: Specifying type without specifying name returns an InvalidInput error.

Valid Values: SOA | A | TXT | NS | CNAME | MX | NAPTR | PTR | SRV | SPF | AAAA | CAA

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<ListResourceRecordSetsResponse>
   <IsTruncated>boolean</IsTruncated>
   <MaxItems>string</MaxItems>
   <NextRecordIdentifier>string</NextRecordIdentifier>
   <NextRecordName>string</NextRecordName>
   <NextRecordType>string</NextRecordType>
   <ResourceRecordSets>
      <ResourceRecordSet>
         <AliasTarget>
            <DNSName>string</DNSName>
            <EvaluateTargetHealth>boolean</EvaluateTargetHealth>
            <HostedZoneId>string</HostedZoneId>
         </AliasTarget>
         <Failover>string</Failover>
         <GeoLocation>
            <ContinentCode>string</ContinentCode>
            <CountryCode>string</CountryCode>
            <SubdivisionCode>string</SubdivisionCode>
         </GeoLocation>
         <HealthCheckId>string</HealthCheckId>
         <MultiValueAnswer>boolean</MultiValueAnswer>
         <Name>string</Name>
         <Region>string</Region>
         <ResourceRecords>
            <ResourceRecord>
               <Value>string</Value>
            </ResourceRecord>
         </ResourceRecords>
         <SetIdentifier>string</SetIdentifier>
         <TrafficPolicyInstanceId>string</TrafficPolicyInstanceId>
         <TTL>long</TTL>
         <Type>string</Type>
         <Weight>long</Weight>
      </ResourceRecordSet>
   </ResourceRecordSets>
</ListResourceRecordSetsResponse>

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service.

ListResourceRecordSetsResponse

Root level tag for the ListResourceRecordSetsResponse parameters.

Required: Yes

IsTruncated

A flag that indicates whether more resource record sets remain to be listed. If your results were truncated, you can make a follow-up pagination request by using the NextRecordName element.

Type: Boolean

MaxItems

The maximum number of records you requested.

Type: String

NextRecordIdentifier

Weighted, latency, geolocation, and failover resource record sets only: If results were truncated for a given DNS name and type, the value of SetIdentifier for the next resource record set that has the current DNS name and type.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

NextRecordName

If the results were truncated, the name of the next record in the list.

This element is present only if IsTruncated is true.

Type: String

Length Constraints: Maximum length of 1024.

NextRecordType

If the results were truncated, the type of the next record in the list.

This element is present only if IsTruncated is true.

Type: String

Valid Values: SOA | A | TXT | NS | CNAME | MX | NAPTR | PTR | SRV | SPF | AAAA | CAA

ResourceRecordSets

Information about multiple resource record sets.

Type: Array of ResourceRecordSet objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidInput

The input is not valid.

HTTP Status Code: 400

NoSuchHostedZone

No hosted zone exists with the ID that you specified.

HTTP Status Code: 404

Examples

Example Request

Copy
GET /2013-04-01/hostedzone/Z1PA6795UKMFR9/rrset?maxitems=1

Example Response

Copy
HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <ListResourceRecordSetsResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/"> <ResourceRecordSets> <ResourceRecordSet> <Name>example.com.</Name> <Type>SOA</Type> <TTL>900</TTL> <ResourceRecords> <ResourceRecord> <Value>ns-2048.awsdns-64.net. hostmaster.awsdns.com. 1 7200 900 1209600 86400</Value> </ResourceRecord> </ResourceRecords> </ResourceRecordSet> </ResourceRecordSets> <IsTruncated>true</IsTruncated> <MaxItems>1</MaxItems> <NextRecordName>example.com.</NextRecordName> <NextRecordType>NS</NextRecordType> </ListResourceRecordSetsResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: