The following code examples show how to use ListHostedZones
.
- AWS CLI
-
To list the hosted zones associated with the current AWS account
The following
list-hosted-zones
command lists summary information about the first 100 hosted zones that are associated with the current AWS account.:aws route53 list-hosted-zones
If you have more than 100 hosted zones, or if you want to list them in groups smaller than 100, include the
--max-items
parameter. For example, to list hosted zones one at a time, use the following command:aws route53 list-hosted-zones --max-items
1
To view information about the next hosted zone, take the value of
NextToken
from the response to the previous command, and include it in the--starting-token
parameter, for example:aws route53 list-hosted-zones --max-items
1
--starting-tokenZ3M3LMPEXAMPLE
-
For API details, see ListHostedZones
in AWS CLI Command Reference.
-
For a complete list of AWS SDK developer guides and code examples, see Using Route 53 with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.