Route53 / Client / list_hosted_zones

list_hosted_zones#

Route53.Client.list_hosted_zones(**kwargs)#

Retrieves a list of the public and private hosted zones that are associated with the current Amazon Web Services 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.

See also: AWS API Documentation

Request Syntax

response = client.list_hosted_zones(
    Marker='string',
    MaxItems='string',
    DelegationSetId='string',
    HostedZoneType='PrivateHostedZone'
)
Parameters:
  • Marker (string) –

    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.

  • MaxItems (string) – (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.

  • DelegationSetId (string) – 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.

  • HostedZoneType (string) – (Optional) Specifies if the hosted zone is private.

Return type:

dict

Returns:

Response Syntax

{
    'HostedZones': [
        {
            'Id': 'string',
            'Name': 'string',
            'CallerReference': 'string',
            'Config': {
                'Comment': 'string',
                'PrivateZone': True|False
            },
            'ResourceRecordSetCount': 123,
            'LinkedService': {
                'ServicePrincipal': 'string',
                'Description': 'string'
            }
        },
    ],
    'Marker': 'string',
    'IsTruncated': True|False,
    'NextMarker': 'string',
    'MaxItems': 'string'
}

Response Structure

  • (dict) –

    • HostedZones (list) –

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

      • (dict) –

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

        • Id (string) –

          The ID that Amazon Route 53 assigned to the hosted zone when you created it.

        • Name (string) –

          The name of the domain. For public hosted zones, this is the name that you have registered with your DNS registrar.

          For information about how to specify characters other than a-z, 0-9, and - (hyphen) and how to specify internationalized domain names, see CreateHostedZone.

        • CallerReference (string) –

          The value that you specified for CallerReference when you created the hosted zone.

        • Config (dict) –

          A complex type that includes the Comment and PrivateZone elements. If you omitted the HostedZoneConfig and Comment elements from the request, the Config and Comment elements don’t appear in the response.

          • Comment (string) –

            Any comments that you want to include about the hosted zone.

          • PrivateZone (boolean) –

            A value that indicates whether this is a private hosted zone.

        • ResourceRecordSetCount (integer) –

          The number of resource record sets in the hosted zone.

        • LinkedService (dict) –

          If the hosted zone was created by another service, the service that created the hosted zone. When a hosted zone is created by another service, you can’t edit or delete it using Route 53.

          • ServicePrincipal (string) –

            If the health check or hosted zone was created by another service, the service that created the resource. When a resource is created by another service, you can’t edit or delete it using Amazon Route 53.

          • Description (string) –

            If the health check or hosted zone was created by another service, an optional description that can be provided by the other service. When a resource is created by another service, you can’t edit or delete it using Amazon Route 53.

    • Marker (string) –

      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.

    • IsTruncated (boolean) –

      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.

    • NextMarker (string) –

      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.

    • MaxItems (string) –

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

Exceptions

  • Route53.Client.exceptions.InvalidInput

  • Route53.Client.exceptions.NoSuchDelegationSet

  • Route53.Client.exceptions.DelegationSetNotReusable