ListHostedZones - Amazon Route 53

ListHostedZones

Retrieves a list of the public and private hosted zones that are associated with the current AWS account. The response includes a HostedZones child element for each hosted zone.

Amazon Route 53 returns a maximum of 100 items in each response. If you have a lot of hosted zones, you can use the maxitems parameter to list them in groups of up to 100.

Request Syntax

GET /2013-04-01/hostedzone?delegationsetid=DelegationSetId&hostedzonetype=HostedZoneType&marker=Marker&maxitems=MaxItems HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

delegationsetid

If you're using reusable delegation sets and you want to list all of the hosted zones that are associated with a reusable delegation set, specify the ID of that reusable delegation set.

Length Constraints: Maximum length of 32.

hostedzonetype

(Optional) Specifies if the hosted zone is private.

Valid Values: PrivateHostedZone

marker

If the value of IsTruncated in the previous response was true, you have more hosted zones. To get more hosted zones, submit another ListHostedZones request.

For the value of marker, specify the value of NextMarker from the previous response, which is the ID of the first hosted zone that Amazon Route 53 will return if you submit another request.

If the value of IsTruncated in the previous response was false, there are no more hosted zones to get.

Length Constraints: Maximum length of 64.

maxitems

(Optional) The maximum number of hosted zones that you want Amazon Route 53 to return. If you have more than maxitems hosted zones, the value of IsTruncated in the response is true, and the value of NextMarker is the hosted zone ID of the first hosted zone that Route 53 will return if you submit another request.

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 <?xml version="1.0" encoding="UTF-8"?> <ListHostedZonesResponse> <HostedZones> <HostedZone> <CallerReference>string</CallerReference> <Config> <Comment>string</Comment> <PrivateZone>boolean</PrivateZone> </Config> <Id>string</Id> <LinkedService> <Description>string</Description> <ServicePrincipal>string</ServicePrincipal> </LinkedService> <Name>string</Name> <ResourceRecordSetCount>long</ResourceRecordSetCount> </HostedZone> </HostedZones> <IsTruncated>boolean</IsTruncated> <Marker>string</Marker> <MaxItems>string</MaxItems> <NextMarker>string</NextMarker> </ListHostedZonesResponse>

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.

ListHostedZonesResponse

Root level tag for the ListHostedZonesResponse parameters.

Required: Yes

HostedZones

A complex type that contains general information about the hosted zone.

Type: Array of HostedZone objects

IsTruncated

A flag indicating whether there are more hosted zones to be listed. If the response was truncated, you can get more hosted zones by submitting another ListHostedZones request and specifying the value of NextMarker in the marker parameter.

Type: Boolean

Marker

For the second and subsequent calls to ListHostedZones, Marker is the value that you specified for the marker parameter in the request that produced the current response.

Type: String

Length Constraints: Maximum length of 64.

MaxItems

The value that you specified for the maxitems parameter in the call to ListHostedZones that produced the current response.

Type: String

NextMarker

If IsTruncated is true, the value of NextMarker identifies the first hosted zone in the next group of hosted zones. Submit another ListHostedZones request, and specify the value of NextMarker from the response in the marker parameter.

This element is present only if IsTruncated is true.

Type: String

Length Constraints: Maximum length of 64.

Errors

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

DelegationSetNotReusable

A reusable delegation set with the specified ID does not exist.

HTTP Status Code: 400

InvalidInput

The input is not valid.

HTTP Status Code: 400

NoSuchDelegationSet

A reusable delegation set with the specified ID does not exist.

HTTP Status Code: 400

Examples

Example Request

This example illustrates one usage of ListHostedZones.

GET /2013-04-01/hostedzone?maxitems=1

Example Response

This example illustrates one usage of ListHostedZones.

HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <ListHostedZonesResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/"> <HostedZones> <HostedZone> <Id>/hostedzone/Z111111QQQQQQQ</Id> <Name>example.com.</Name> <CallerReference>MyUniqueIdentifier1</CallerReference> <Config> <Comment>This is my first hosted zone.</Comment> <PrivateZone>false</PrivateZone> </Config> <ResourceRecordSetCount>42</ResourceRecordSetCount> </HostedZone> </HostedZones> <IsTruncated>true</IsTruncated> <NextMarker>Z222222VVVVVVV</NextMarker> <MaxItems>1</MaxItems> </ListHostedZonesResponse>

See Also

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