

文档 AWS SDK 示例 GitHub 存储库中还有更多 [S AWS DK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 将 `GetHostedZone` 与 CLI 配合使用
<a name="route-53_example_route-53_GetHostedZone_section"></a>

以下代码示例演示如何使用 `GetHostedZone`。

------
#### [ CLI ]

**AWS CLI**  
**获取有关托管区的信息**  
以下 `get-hosted-zone` 命令获取 `id` 为 `Z1R8UBAEXAMPLE` 的托管区的相关信息：  

```
aws route53 get-hosted-zone --id Z1R8UBAEXAMPLE
```
+  有关 API 的详细信息，请参阅*AWS CLI 命令参考[GetHostedZone](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53/get-hosted-zone.html)*中的。

------
#### [ PowerShell ]

**适用于 PowerShell V4 的工具**  
**示例 1：返回 ID 为 Z1D633 的托管区域的详细信息PJN98FT9。**  

```
Get-R53HostedZone -Id Z1D633PJN98FT9
```
+  有关 API 的详细信息，请参阅 *AWS Tools for PowerShell Cmdlet 参考 (V* 4) [GetHostedZone](https://docs.aws.amazon.com/powershell/v4/reference)中的。

**适用于 PowerShell V5 的工具**  
**示例 1：返回 ID 为 Z1D633 的托管区域的详细信息PJN98FT9。**  

```
Get-R53HostedZone -Id Z1D633PJN98FT9
```
+  有关 API 的详细信息，请参阅 *AWS Tools for PowerShell Cmdlet 参考 (V* 5) [GetHostedZone](https://docs.aws.amazon.com/powershell/v5/reference)中的。

------